-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Get your own integrations for admin user #9698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Artem Savchenko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the integration listing logic to provide admin users with their own integrations when no specific social ID is provided. The change ensures that admin users (non-system accounts) can retrieve their personal integrations through the service interface.
- Adds conditional logic to fetch admin user's own integrations when no socialId is specified
- Imports
systemAccountUuid
to distinguish between system and regular admin accounts
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Connected to Huly®: UBERF-13133 |
@@ -694,6 +695,10 @@ export async function listIntegrations ( | |||
|
|||
if (isAllowedService) { | |||
socialIds = socialId != null ? [socialId] : undefined | |||
if (socialIds === undefined && account !== systemAccountUuid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's better remove admin check from verifyAllowedServices and fix all places where admin: true is potentially used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not add a workarounds, we need to fix admin: 'true' to a proper service name.
Signed-off-by: Artem Savchenko <[email protected]>
Signed-off-by: Artem Savchenko <[email protected]>
Signed-off-by: Artem Savchenko <[email protected]>
verifyAllowedServices(['github', 'telegram-bot', 'gmail', 'tool', 'workspace', 'hulygram', 'google-calendar'], extra) | ||
if (extra?.admin !== 'true') { | ||
verifyAllowedServices( | ||
['github', 'telegram-bot', 'gmail', 'tool', 'workspace', 'hulygram', 'google-calendar'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I suggest to use environment variable instead of hardcoding services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about env vars as we'll end up having a separate var for every method. I think we'll need to discuss how to better resolve it for all the methods at once.
No description provided.