Add setting authorization action
SyncRefund
MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -1150,6 +1150,8 @@ export default class AuthorizationService {
setting.canRead = true; // Always true as it should be filtered upfront
setting.canUpdate = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.SETTING, Action.UPDATE, authorizationFilter);
setting.canDelete = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.SETTING, Action.DELETE, authorizationFilter);
+ setting.canSyncRefund = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.TRANSACTION, Action.SYNCHRONIZE_REFUNDED_TRANSACTION, authorizationFilter);
+
// Remove auth flags set to false
Utils.removeCanPropertiesWithFalseValue(setting);
}

MODIFY
src/types/Authorization.ts
src/types/Authorization.ts
@@ -360,6 +360,10 @@ export interface TransactionAuthorizationActions extends AuthorizationActions {
canReadChargingStation?: boolean;
}
+export interface SettingAuthorizationActions extends AuthorizationActions {
+ canSyncRefund?: boolean;
+}
+
export enum DynamicAuthorizationFilterName {
ASSIGNED_SITES_COMPANIES = 'AssignedSitesCompanies',
SITES_ADMIN = 'SitesAdmin',

MODIFY
src/types/Setting.ts
src/types/Setting.ts
-import { AuthorizationActions } from './Authorization';
import CreatedUpdatedProps from './CreatedUpdatedProps';
+import { SettingAuthorizationActions } from './Authorization';
import { TenantComponents } from './Tenant';
export enum TechnicalSettings {
@@ -24,7 +24,7 @@ export enum IntegrationSettings {
STATISTICS = 'statistics'
}
-export interface Setting extends AuthorizationActions, CreatedUpdatedProps {
+export interface Setting extends SettingAuthorizationActions, CreatedUpdatedProps {
id?: string;
identifier: TenantComponents | TechnicalSettings;
sensitiveData?: string[];

Add setting authorization action

- SyncRefund