Skip to content

Conversation

ArtyomSavchenko
Copy link
Contributor

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link

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) {
Copy link
Member

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.

Copy link
Member

@haiodo haiodo left a 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]>
@ArtyomSavchenko ArtyomSavchenko marked this pull request as draft August 20, 2025 05:10
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'],
Copy link
Member

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

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants