Site Admin can manage user status
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -807,7 +807,16 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['SitesAdmin', 'LocalIssuer']
+ filters: ['SitesAdmin', 'LocalIssuer'],
+ metadata: {
+ status: {
+ visible: true,
+ enabled: true,
+ mandatory: true,
+ values: [],
+ defaultValue: null,
+ }
+ },
}
},
attributes: [

MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -195,6 +195,7 @@ export default class AuthorizationService {
}
public static async addUsersAuthorizations(tenant: Tenant, userToken: UserToken, users: UserDataResult, authorizationFilter: AuthorizationFilter): Promise<void> {
+ users.metadata = authorizationFilter.metadata;
users.canCreate = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.USER, Action.CREATE, authorizationFilter);
// Enrich
for (const user of users.result) {
@@ -223,7 +224,7 @@ export default class AuthorizationService {
filters: {},
dataSources: new Map(),
projectFields: [],
- authorized: false
+ authorized: false,
};
// Check static & dynamic authorization
await AuthorizationService.canPerformAuthorizationAction(

Site Admin can manage user status