@uniorganization/uni-lib 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -136,7 +136,7 @@ let TenantAuthorizationService = TenantAuthorizationService_1 = class TenantAuth
|
|
|
136
136
|
this.userRoleRepository
|
|
137
137
|
.createQueryBuilder('assignment')
|
|
138
138
|
.innerJoinAndSelect('assignment.role', 'role', 'role.client_id = assignment.client_id')
|
|
139
|
-
.innerJoinAndSelect('role.module', 'module', 'module.is_active = true')
|
|
139
|
+
.innerJoinAndSelect('role.module', 'module', 'module.is_active = true AND (module.client_id = assignment.client_id OR module.client_id IS NULL)')
|
|
140
140
|
.leftJoinAndSelect('role.privileges', 'definition', 'definition.client_id = assignment.client_id')
|
|
141
141
|
.leftJoinAndSelect('definition.privilege', 'privilege', 'privilege.client_id = assignment.client_id AND privilege."IS_ACTIVE" <> 0')
|
|
142
142
|
.where('assignment."USER_ID" = :userId', { userId })
|
|
@@ -158,6 +158,10 @@ let TenantAuthorizationService = TenantAuthorizationService_1 = class TenantAuth
|
|
|
158
158
|
JOIN stm."ACCESS_ROLES" role
|
|
159
159
|
ON role.id = membership.role_id
|
|
160
160
|
AND role.is_active
|
|
161
|
+
AND (
|
|
162
|
+
role.scope = 'GLOBAL'
|
|
163
|
+
OR role.client_id = membership.client_id
|
|
164
|
+
)
|
|
161
165
|
LEFT JOIN stm."ACCESS_ROLE_PERMISSIONS" definition
|
|
162
166
|
ON definition.role_id = role.id
|
|
163
167
|
LEFT JOIN stm."ACCESS_PERMISSIONS" permission
|