Added metadata in AuthDef for admin and super admin roles
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -10,7 +10,20 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
'id', 'name', 'firstName', 'email', 'role', 'status', 'issuer', 'createdOn', 'createdBy',
'lastChangedOn', 'lastChangedBy', 'eulaAcceptedOn', 'eulaAcceptedVersion', 'locale',
'billingData.customerID', 'billingData.lastChangedOn'
- ]
+ ],
+ condition: {
+ Fn: 'custom:dynamicAuthorizations',
+ args: {
+ asserts: [],
+ filters: [],
+ metadata: {
+ status: {
+ visible: true,
+ mandatory: true,
+ }
+ },
+ }
+ },
},
{
resource: Entity.USER, action: Action.DELETE,
@@ -71,9 +84,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
},
admin: {
grants: [
- {
- resource: Entity.USER, action: Action.SYNCHRONIZE_BILLING_USERS,
- },
+ { resource: Entity.USER, action: Action.SYNCHRONIZE_BILLING_USERS },
{
resource: Entity.USER,
action: [
@@ -83,7 +94,20 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
'id', 'name', 'firstName', 'email', 'role', 'status', 'issuer', 'createdOn', 'createdBy',
'lastChangedOn', 'lastChangedBy', 'eulaAcceptedOn', 'eulaAcceptedVersion', 'locale',
'billingData.customerID', 'billingData.lastChangedOn', 'technical', 'freeAccess'
- ]
+ ],
+ condition: {
+ Fn: 'custom:dynamicAuthorizations',
+ args: {
+ asserts: [],
+ filters: [],
+ metadata: {
+ status: {
+ visible: true,
+ mandatory: true,
+ }
+ },
+ }
+ }
},
{
resource: Entity.USER, action: Action.IN_ERROR,

MODIFY
src/validator/SchemaValidator.ts
src/validator/SchemaValidator.ts
@@ -72,10 +72,12 @@ export default class SchemaValidator {
protected validate(schema: Schema, data: Record<string, unknown>): any {
let fnValidate: ValidateFunction<unknown>;
if (!schema.$id) {
+ if (this.isDevelopmentEnv()) {
this.logConsoleError('====================================');
this.logConsoleError('Missing schema ID:');
this.logConsoleError(JSON.stringify(schema));
this.logConsoleError('====================================');
+ }
// Not cached: Compile schema
fnValidate = this.ajv.compile(schema);
} else {

Added metadata in AuthDef for admin and super admin roles