Add missing billing account authorization action
MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -1061,6 +1061,8 @@ export default class AuthorizationService {
authorizationFilter: AuthorizationFilter): Promise<void> {
// Add Meta Data
billingAccounts.metadata = authorizationFilter.metadata;
+ billingAccounts.canCreate = await AuthorizationService.canPerformAuthorizationAction(
+ tenant, userToken, Entity.BILLING_ACCOUNT, Action.CREATE, authorizationFilter);
billingAccounts.canListUsers = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.USER, Action.LIST, authorizationFilter);
}

MODIFY
src/types/DataResult.ts
src/types/DataResult.ts
@@ -133,6 +133,7 @@ export interface BillingPaymentMethodDataResult extends DataResult<BillingPaymen
}
export interface BillingAccountsDataResult extends DataResult<BillingAccount> {
+ canCreate?: boolean;
canListUsers?: boolean;
}

Add missing billing account authorization action