admin cannot have admin nor owner roles
duplicated transaction refund to admin where he is owner
MODIFY
src/authorization/Authorizations.ts
src/authorization/Authorizations.ts
@@ -983,12 +983,6 @@ export default class Authorizations {
switch (userRole) {
case UserRole.ADMIN:
roles.push('admin');
- if (sitesAdminCount > 0) {
- roles.push('siteAdmin');
- }
- if (sitesOwnerCount > 0) {
- roles.push('siteOwner');
- }
break;
case UserRole.SUPER_ADMIN:
roles.push('superAdmin');

MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -670,6 +670,16 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
'id', 'userID', 'user.id', 'user.name', 'user.firstName', 'user.email', 'tagID'
]
},
+ {
+ resource: Entity.TRANSACTION, action: Action.REFUND_TRANSACTION,
+ condition: {
+ Fn: 'custom:dynamicAuthorizations',
+ args: {
+ asserts: [],
+ filters: ['SitesOwner']
+ }
+ }
+ },
{
resource: Entity.TRANSACTION, action: Action.EXPORT_COMPLETED_TRANSACTION,
condition: {

admin cannot have admin nor owner roles
- duplicated transaction refund to admin where he is owner