Add entity new Source
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -412,6 +412,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
{ resource: Entity.NOTIFICATION, action: Action.CREATE },
{ resource: Entity.PAYMENT_METHOD, action: Action.LIST },
{ resource: Entity.PAYMENT_METHOD, action: [Action.READ, Action.CREATE, Action.DELETE] },
+ { resource: Entity.SOURCE, action: Action.LIST },
]
},
basic: {
@@ -1276,6 +1277,7 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
}
},
},
+ { resource: Entity.SOURCE, action: Action.LIST },
]
},
siteOwner: {

MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -314,6 +314,7 @@ export default class AuthorizationService {
tags.canExport = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.TAG, Action.EXPORT, authorizationFilter);
tags.canUnassign = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.TAG, Action.UNASSIGN, authorizationFilter);
tags.canListUsers = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.USER, Action.LIST, authorizationFilter);
+ tags.canListSources = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.SOURCE, Action.LIST, authorizationFilter);
for (const tag of tags.result) {
await AuthorizationService.addTagAuthorizations(tenant, userToken, tag, authorizationFilter);
}

MODIFY
src/types/Authorization.ts
src/types/Authorization.ts
@@ -92,6 +92,7 @@ export enum Entity {
NOTIFICATION = 'Notification',
TAG = 'Tag',
PAYMENT_METHOD = 'PaymentMethod',
+ SOURCE = 'Source',
}
export enum Action {

MODIFY
src/types/DataResult.ts
src/types/DataResult.ts
@@ -65,6 +65,7 @@ export interface TagDataResult extends DataResult<Tag> {
canUnassign: boolean;
canAssign: boolean;
canListUsers: boolean;
+ canListSources: boolean;
}
export interface TransactionDataResult extends DataResult<Transaction> {

Add entity new Source