Permissions and sync groups fixes (#12555)

* data source permissions and sync groups fixes

* update
This commit is contained in:
Anantshree Chandola 2025-04-14 15:25:35 +05:30 committed by GitHub
parent b9303fa4ab
commit c5703c8438
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -348,7 +348,7 @@ export class AuthUtilService implements IAuthUtilService {
// IF current role is empty -> user not exist
// IF new role not equals current one
if (!currentRole || newRole !== currentRole) {
if (!currentRole || (newRole !== currentRole && groups.length > 0)) {
await this.roleUtilService.editDefaultGroupUserRole(
organizationId,
{ newRole, userId, currentRole: currentRoleObj },

View file

@ -41,7 +41,6 @@ export class FeatureAbilityFactory extends AbilityFactory<FEATURE_KEY, Subjects>
if (isBuilder) {
// Only builder can do scope change, Get call is there on app builder
can(FEATURE_KEY.SCOPE_CHANGE, DataSource);
can(FEATURE_KEY.GET, DataSource);
can(FEATURE_KEY.GET_FOR_APP, DataSource);
}
@ -100,7 +99,7 @@ export class FeatureAbilityFactory extends AbilityFactory<FEATURE_KEY, Subjects>
}
if (isAllViewable) {
can([FEATURE_KEY.GET, FEATURE_KEY.GET_BY_ENVIRONMENT], DataSource);
can([FEATURE_KEY.GET_BY_ENVIRONMENT], DataSource);
return;
}
if (