aligned assign / unassign actions
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -182,6 +182,21 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
'address.department', 'address.region', 'address.country', 'address.coordinates'
]
},
+ {
+ resource: Entity.USER, action: [
+ Action.ASSIGN_UNASSIGN_SITES,
+ ],
+ condition: {
+ Fn: 'custom:dynamicAuthorizations',
+ args: {
+ asserts: [],
+ filters: ['LocalIssuer']
+ }
+ },
+ attributes: [
+ 'id'
+ ]
+ },
{
resource: Entity.COMPANY, action: Action.LIST,
attributes: [
@@ -301,7 +316,9 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
},
},
{
- resource: Entity.USER_SITE, action: [Action.ASSIGN, Action.ASSIGN_SITES_TO_USER, Action.READ, Action.UPDATE, Action.LIST],
+ resource: Entity.SITE, action: [
+ Action.ASSIGN_UNASSIGN_USERS
+ ],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
@@ -310,33 +327,24 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
}
},
attributes: [
- 'site.id', 'site.name', 'site.address.city', 'site.address.country', 'siteAdmin', 'siteOwner', 'userID'
+ 'id'
]
},
{
- resource: Entity.USER_SITE,
- action: Action.UNASSIGN,
+ resource: Entity.USER_SITE, action: [Action.ASSIGN_SITES_TO_USER, Action.UNASSIGN_SITES_FROM_USER, Action.READ, Action.UPDATE, Action.LIST],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
filters: []
}
- }
- },
- {
- resource: Entity.USER_SITE,
- action: Action.UNASSIGN_SITES_FROM_USER,
- condition: {
- Fn: 'custom:dynamicAuthorizations',
- args: {
- asserts: [],
- filters: ['-OwnUser', 'LocalIssuer']
- }
},
+ attributes: [
+ 'site.id', 'site.name', 'site.address.city', 'site.address.country', 'siteAdmin', 'siteOwner', 'userID'
+ ]
},
{
- resource: Entity.SITE_USER, action: [Action.ASSIGN, Action.ASSIGN_USERS_TO_SITE, Action.READ, Action.UPDATE, Action.LIST],
+ resource: Entity.SITE_USER, action: [Action.ASSIGN_USERS_TO_SITE, Action.UNASSIGN_USERS_FROM_SITE, Action.READ, Action.UPDATE, Action.LIST],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
@@ -348,28 +356,6 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
'user.id', 'user.name', 'user.firstName', 'user.email', 'user.role', 'siteID', 'siteAdmin', 'siteOwner',
]
},
- {
- resource: Entity.SITE_USER,
- action: Action.UNASSIGN,
- condition: {
- Fn: 'custom:dynamicAuthorizations',
- args: {
- asserts: [],
- filters: ['LocalIssuer']
- }
- }
- },
- {
- resource: Entity.SITE_USER,
- action: Action.UNASSIGN_USERS_FROM_SITE,
- condition: {
- Fn: 'custom:dynamicAuthorizations',
- args: {
- asserts: [],
- filters: ['-OwnUser', 'LocalIssuer']
- }
- },
- },
{
resource: Entity.SITE_AREA, action: Action.LIST,
attributes: [
@@ -1514,12 +1500,12 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
}
},
{
- resource: Entity.USER_SITE, action: [Action.ASSIGN, Action.ASSIGN_SITES_TO_USER, Action.READ, Action.UPDATE, Action.LIST],
+ resource: Entity.USER_SITE, action: [Action.ASSIGN_SITES_TO_USER, Action.UNASSIGN_SITES_FROM_USER, Action.READ, Action.UPDATE, Action.LIST],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
asserts: [],
- filters: ['SitesAdminOrOwner', 'LocalIssuer']
+ filters: ['LocalIssuer']
}
},
attributes: [
@@ -1527,8 +1513,8 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
]
},
{
- resource: Entity.USER_SITE,
- action: Action.UNASSIGN,
+ resource: Entity.USER,
+ action: [Action.ASSIGN_UNASSIGN_SITES],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
@@ -1536,20 +1522,12 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
filters: ['SitesAdminOrOwner', 'LocalIssuer']
}
},
+ attributes: [
+ 'id',
+ ]
},
{
- resource: Entity.USER_SITE,
- action: Action.UNASSIGN_SITES_FROM_USER,
- condition: {
- Fn: 'custom:dynamicAuthorizations',
- args: {
- asserts: [],
- filters: ['-OwnUser', 'LocalIssuer']
- }
- },
- },
- {
- resource: Entity.SITE_USER, action: [Action.ASSIGN, Action.ASSIGN_USERS_TO_SITE, Action.READ, Action.UPDATE, Action.LIST],
+ resource: Entity.SITE_USER, action: [Action.ASSIGN_USERS_TO_SITE, Action.UNASSIGN_USERS_FROM_SITE, Action.READ, Action.UPDATE, Action.LIST],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
@@ -1562,8 +1540,8 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
]
},
{
- resource: Entity.SITE_USER,
- action: Action.UNASSIGN,
+ resource: Entity.SITE,
+ action: [Action.ASSIGN_UNASSIGN_USERS],
condition: {
Fn: 'custom:dynamicAuthorizations',
args: {
@@ -1571,17 +1549,9 @@ export const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
filters: ['SitesAdminOrOwner', 'LocalIssuer']
}
},
- },
- {
- resource: Entity.SITE_USER,
- action: Action.UNASSIGN_USERS_FROM_SITE,
- condition: {
- Fn: 'custom:dynamicAuthorizations',
- args: {
- asserts: [],
- filters: ['-OwnUser', 'LocalIssuer']
- }
- },
+ attributes: [
+ 'id',
+ ]
},
{
resource: Entity.SITE, action: [Action.UPDATE, Action.MAINTAIN_PRICING_DEFINITIONS, Action.EXPORT_OCPP_PARAMS],

MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -13,9 +13,6 @@ import { HttpSiteAreaGetRequest, HttpSiteAreasGetRequest } from '../../../../typ
import { HttpSiteAssignUsersRequest, HttpSiteGetRequest, HttpSiteUsersRequest } from '../../../../types/requests/HttpSiteRequest';
import { HttpTagGetRequest, HttpTagsGetRequest } from '../../../../types/requests/HttpTagRequest';
import { HttpUserGetRequest, HttpUserSitesAssignRequest, HttpUserSitesGetRequest, HttpUsersGetRequest } from '../../../../types/requests/HttpUserRequest';
-import Site, { UserSite } from '../../../../types/Site';
-import Tenant, { TenantComponents } from '../../../../types/Tenant';
-import User, { SiteUser, UserRole } from '../../../../types/User';
import AppAuthError from '../../../../exception/AppAuthError';
import Asset from '../../../../types/Asset';
@@ -34,8 +31,11 @@ import PricingDefinition from '../../../../types/Pricing';
import RegistrationToken from '../../../../types/RegistrationToken';
import { ServerAction } from '../../../../types/Server';
import { Setting } from '../../../../types/Setting';
+import Site from '../../../../types/Site';
import SiteArea from '../../../../types/SiteArea';
import Tag from '../../../../types/Tag';
+import Tenant from '../../../../types/Tenant';
+import User from '../../../../types/User';
import UserToken from '../../../../types/UserToken';
import Utils from '../../../../utils/Utils';
@@ -83,10 +83,8 @@ export default class AuthorizationService {
tenant, userToken, Entity.SITE_AREA, Action.EXPORT_OCPP_PARAMS, authorizationFilter, { SiteID: site.id }, site);
site.canGenerateQrCode = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE_AREA, Action.GENERATE_QR, authorizationFilter, { SiteID: site.id }, site);
- site.canAssignUsers = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.SITE_USER, Action.ASSIGN, authorizationFilter, { SiteID: site.id }, site);
- site.canUnassignUsers = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.SITE_USER, Action.UNASSIGN, authorizationFilter, { SiteID: site.id }, site);
+ site.canAssignUnassignUsers = await AuthorizationService.canPerformAuthorizationAction(
+ tenant, userToken, Entity.SITE, Action.ASSIGN_UNASSIGN_USERS, authorizationFilter, { SiteID: site.id }, site);
site.canListSiteUsers = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE_USER, Action.LIST, authorizationFilter, { SiteID: site.id }, site);
// Optimize data over the net
@@ -178,7 +176,7 @@ export default class AuthorizationService {
authorized: false,
};
// Check static & dynamic authorization
- const authAction = action === ServerAction.ADD_USERS_TO_SITE ? Action.ASSIGN : Action.UNASSIGN;
+ const authAction = action === ServerAction.ADD_USERS_TO_SITE ? Action.ASSIGN_USERS_TO_SITE : Action.UNASSIGN_USERS_FROM_SITE;
await this.canPerformAuthorizationAction(tenant, userToken, Entity.SITE_USER, authAction,
authorizations, filteredRequest, null, true);
return authorizations;
@@ -205,26 +203,13 @@ export default class AuthorizationService {
userSites.metadata = authorizationFilter.metadata;
// Add Authorizations
userSites.canUpdateUserSites = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.USER_SITE, Action.UPDATE, authorizationFilter);
- for (const userSite of userSites.result) {
- await AuthorizationService.addUserSiteAuthorizations(tenant, userToken, userSite, authorizationFilter);
- }
}
- public static async addUserSiteAuthorizations(tenant: Tenant, userToken: UserToken, userSite: UserSite, authorizationFilter: AuthorizationFilter): Promise<void> {
- userSite.canAssignToUser = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.USER_SITE, Action.ASSIGN, authorizationFilter, { UserID: userSite.userID }, userSite);
- userSite.canUnassignFromUser = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.USER_SITE, Action.UNASSIGN, authorizationFilter, { UserID: userSite.userID }, userSite);
- // Optimize data over the net
- Utils.removeCanPropertiesWithFalseValue(userSite);
- }
-
- // eslint-disable-next-line max-len
public static async addUserSiteAuthToSitesAuthorizations(tenant: Tenant, userToken: UserToken, user: User, sites: Site[], authorizationFilter: AuthorizationFilter): Promise<void> {
for (const site of sites) {
- site.canAssignToUser = await AuthorizationService.canPerformAuthorizationAction(
+ site.canAssignSitesToUser = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.USER_SITE, Action.ASSIGN_SITES_TO_USER, authorizationFilter, { UserID: user.id }, site);
- site.canUnassignFromUser = await AuthorizationService.canPerformAuthorizationAction(
+ site.canUnassignSitesFromUser = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.USER_SITE, Action.UNASSIGN_SITES_FROM_USER, authorizationFilter, { UserID: user.id }, site);
// Optimize data over the net
Utils.removeCanPropertiesWithFalseValue(site);
@@ -236,29 +221,17 @@ export default class AuthorizationService {
siteUsers.metadata = authorizationFilter.metadata;
// Add Authorizations
siteUsers.canUpdateSiteUsers = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.SITE_USER, Action.UPDATE, authorizationFilter);
- for (const siteUser of siteUsers.result) {
- await AuthorizationService.addSiteUserAuthorizations(tenant, userToken, siteUser, authorizationFilter);
- }
- }
-
- public static async addSiteUserAuthorizations(tenant: Tenant, userToken: UserToken, siteUser: SiteUser, authorizationFilter: AuthorizationFilter): Promise<void> {
- siteUser.canAssignToSite = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.SITE_USER, Action.ASSIGN, authorizationFilter, { UserID: siteUser.user.id }, siteUser);
- siteUser.canUnassignFromSite = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.SITE_USER, Action.UNASSIGN, authorizationFilter, { UserID: siteUser.user.id }, siteUser);
- // Optimize data over the net
- Utils.removeCanPropertiesWithFalseValue(siteUser);
}
// eslint-disable-next-line max-len
public static async addSiteUserAuthToUsersAuthorizations(tenant: Tenant, userToken: UserToken, site: Site, users: User[], authorizationFilter: AuthorizationFilter): Promise<void> {
for (const user of users) {
- user.canAssignToSite = await AuthorizationService.canPerformAuthorizationAction(
+ user.canAssignUsersToSite = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE_USER, Action.ASSIGN_USERS_TO_SITE, authorizationFilter, { UserID: user.id }, site);
- user.canUnassignFromSite = await AuthorizationService.canPerformAuthorizationAction(
+ user.canUnassignUsersFromSite = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.SITE_USER, Action.UNASSIGN_USERS_FROM_SITE, authorizationFilter, { UserID: user.id }, site);
// Optimize data over the net
- Utils.removeCanPropertiesWithFalseValue(site);
+ Utils.removeCanPropertiesWithFalseValue(user);
}
}
@@ -301,10 +274,8 @@ export default class AuthorizationService {
tenant, userToken, Entity.USER, Action.UPDATE, authorizationFilter, { UserID: user.id }, user);
user.canDelete = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.USER, Action.DELETE, authorizationFilter, { UserID: user.id }, user);
- user.canAssignSites = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.USER_SITE, Action.ASSIGN, authorizationFilter, { UserID: user.id }, user);
- user.canUnassignSites = await AuthorizationService.canPerformAuthorizationAction(
- tenant, userToken, Entity.USER_SITE, Action.UNASSIGN, authorizationFilter, { UserID: user.id }, user);
+ user.canAssignUnassignSites = await AuthorizationService.canPerformAuthorizationAction(
+ tenant, userToken, Entity.USER, Action.ASSIGN_UNASSIGN_SITES, authorizationFilter, { UserID: user.id }, user);
user.canListUserSites = await AuthorizationService.canPerformAuthorizationAction(
tenant, userToken, Entity.USER_SITE, Action.LIST, authorizationFilter, { UserID: user.id }, user);
user.canListTags = await AuthorizationService.canPerformAuthorizationAction(
@@ -1203,31 +1174,6 @@ export default class AuthorizationService {
Utils.removeCanPropertiesWithFalseValue(carCatalog);
}
- private static async checkAssignedSites(tenant: Tenant, userToken: UserToken,
- filteredRequest: { SiteID?: string }, authorizationFilters: AuthorizationFilter): Promise<void> {
- if (userToken.role !== UserRole.ADMIN && userToken.role !== UserRole.SUPER_ADMIN) {
- if (Utils.isTenantComponentActive(tenant, TenantComponents.ORGANIZATION)) {
- // Get assigned Site IDs assigned to user from DB
- const siteIDs = await Authorizations.getAssignedSiteIDs(tenant, userToken);
- if (!Utils.isEmptyArray(siteIDs)) {
- // Force the filter
- authorizationFilters.filters.siteIDs = siteIDs;
- // Check if filter is provided
- if (filteredRequest?.SiteID) {
- const filteredSiteIDs = filteredRequest.SiteID.split('|');
- // Override
- authorizationFilters.filters.siteIDs = filteredSiteIDs.filter(
- (siteID) => authorizationFilters.filters.siteIDs.includes(siteID));
- }
- }
- if (!Utils.isEmptyArray(authorizationFilters.filters.siteIDs)) {
- authorizationFilters.authorized = true;
- }
- } else {
- authorizationFilters.authorized = true;
- }
- }
- }
private static filterProjectFields(authFields: string[], httpProjectField: string): string[] {
let fields = authFields;

MODIFY
src/server/rest/v1/service/SiteService.ts
src/server/rest/v1/service/SiteService.ts
@@ -88,10 +88,10 @@ export default class SiteService {
Action.UPDATE, Entity.SITE, MODULE_NAME, 'handleAssignUsersToSite');
// Filter request
const filteredRequest = SiteValidatorRest.getInstance().validateSiteAssignUsersReq(req.body);
- const serverAction = action === ServerAction.ADD_USERS_TO_SITE ? Action.ASSIGN_USERS_TO_SITE : Action.UNASSIGN_USERS_FROM_SITE;
// Check and Get Site
- const site = await UtilsService.checkAndGetSiteAuthorization(req.tenant, req.user, filteredRequest.siteID, serverAction, action);
+ const site = await UtilsService.checkAndGetSiteAuthorization(req.tenant, req.user, filteredRequest.siteID, Action.ASSIGN_UNASSIGN_USERS, action);
// Check and Get Users
+ const serverAction = action === ServerAction.ADD_USERS_TO_SITE ? Action.ASSIGN_USERS_TO_SITE : Action.UNASSIGN_USERS_FROM_SITE;
const users = await UtilsService.checkAndGetSiteUsersAuthorization(req.tenant, req.user, site, filteredRequest.userIDs, action);
// Save
for (const user of users) {
@@ -130,9 +130,7 @@ export default class SiteService {
Action.UPDATE, Entity.SITE, MODULE_NAME, 'handleGetUsers');
// Filter
const filteredRequest = SiteValidatorRest.getInstance().validateSiteGetUsersReq(req.query);
- // Check Site Auth
- await UtilsService.checkAndGetSiteAuthorization(req.tenant, req.user, filteredRequest.SiteID, Action.READ, action);
- // Check dynamic auth for reading Users
+ // Check dynamic auth for listing sites users
const authorizations = await AuthorizationService.checkAndGetSiteUsersAuthorizations(req.tenant,
req.user, filteredRequest, false);
if (!authorizations.authorized) {

MODIFY
src/server/rest/v1/service/UserService.ts
src/server/rest/v1/service/UserService.ts
@@ -13,7 +13,6 @@ import AppAuthError from '../../../../exception/AppAuthError';
import AppError from '../../../../exception/AppError';
import AsyncTaskBuilder from '../../../../async-task/AsyncTaskBuilder';
import AuthorizationService from './AuthorizationService';
-import Authorizations from '../../../../authorization/Authorizations';
import BillingFactory from '../../../../integration/billing/BillingFactory';
import CSVError from 'csvtojson/v2/CSVError';
import CarStorage from '../../../../storage/mongodb/CarStorage';
@@ -110,10 +109,10 @@ export default class UserService {
Action.UPDATE, Entity.SITE, 'SiteService', 'handleAssignSitesToUser');
// Filter request
const filteredRequest = UserValidatorRest.getInstance().validateUserSitesAssignReq(req.body);
- const serverAction = action === ServerAction.ADD_SITES_TO_USER ? Action.ASSIGN_SITES_TO_USER : Action.UNASSIGN_SITES_FROM_USER;
// Check and Get User
- const user = await UtilsService.checkAndGetUserAuthorization(req.tenant, req.user, filteredRequest.userID, serverAction, action);
+ const user = await UtilsService.checkAndGetUserAuthorization(req.tenant, req.user, filteredRequest.userID, Action.ASSIGN_UNASSIGN_SITES, action);
// Check and Get Sites
+ const serverAction = action === ServerAction.ADD_SITES_TO_USER ? Action.ASSIGN_SITES_TO_USER : Action.UNASSIGN_SITES_FROM_USER;
const sites = await UtilsService.checkAndGetUserSitesAuthorization(req.tenant, req.user, user, filteredRequest.siteIDs, action);
// Save
for (const site of sites) {
@@ -123,7 +122,7 @@ export default class UserService {
errorCode: HTTPAuthError.FORBIDDEN,
user: req.user,
action: serverAction, entity: Entity.USER_SITE,
- module: MODULE_NAME, method: 'checkAndGetPricingDefinitionAuthorization',
+ module: MODULE_NAME, method: 'handleAssignSitesToUser',
value: site.id
});
}
@@ -354,15 +353,7 @@ export default class UserService {
Action.UPDATE, Entity.USER, MODULE_NAME, 'handleGetSites');
// Filter
const filteredRequest = UserValidatorRest.getInstance().validateUserSitesGetReq(req.query);
- // Check User
- try {
- await UtilsService.checkAndGetUserAuthorization(
- req.tenant, req.user, filteredRequest.UserID, Action.READ, action);
- } catch (error) {
- UtilsService.sendEmptyDataResult(res, next);
- return;
- }
- // Check dynamic auth for reading Sites
+ // Check dynamic auth for listing user sites
const authorizations = await AuthorizationService.checkAndGetUserSitesAuthorizations(req.tenant,
req.user, filteredRequest);
if (!authorizations.authorized) {
@@ -374,7 +365,7 @@ export default class UserService {
{
search: filteredRequest.Search,
userIDs: [filteredRequest.UserID],
- ...authorizations.filters
+ ...authorizations.filters // ici liste vide si le check and get foire
},
{
limit: filteredRequest.Limit,

MODIFY
src/types/Authorization.ts
src/types/Authorization.ts
@@ -154,10 +154,12 @@ export enum Action {
TRIGGER_JOB = 'TriggerJob',
DOWNLOAD = 'Download',
IMPORT = 'Import',
- ASSIGN_USERS_TO_SITE = 'AssignToSite',
- UNASSIGN_USERS_FROM_SITE = 'UnassignFromSite',
- ASSIGN_SITES_TO_USER = 'AssignToUser',
- UNASSIGN_SITES_FROM_USER = 'UnassignFromUser',
+ ASSIGN_USERS_TO_SITE = 'AssignUsersToSite',
+ UNASSIGN_USERS_FROM_SITE = 'UnassignUsersFromSite',
+ ASSIGN_SITES_TO_USER = 'AssignSitesToUser',
+ UNASSIGN_SITES_FROM_USER = 'UnassignSitesFromUser',
+ ASSIGN_UNASSIGN_USERS = 'AssignUnassignUsers',
+ ASSIGN_UNASSIGN_SITES = 'AssignUnassignSites',
ASSIGN_ASSETS_TO_SITE_AREA = 'AssignAssets',
UNASSIGN_ASSETS_FROM_SITE_AREA = 'UnassignAssets',
READ_ASSETS_FROM_SITE_AREA = 'ReadAssets',
@@ -209,10 +211,9 @@ export interface AuthorizationActions {
}
export interface UserAuthorizationActions extends AuthorizationActions {
- canAssignSites?: boolean;
- canUnassignSites?: boolean;
- canAssignToSite?: boolean;
- canUnassignFromSite?: boolean;
+ canAssignUnassignSites?: boolean;
+ canAssignUsersToSite?: boolean;
+ canUnassignUsersFromSite?: boolean;
canListUserSites?: boolean;
canListTags?: boolean;
canListTransactions?: boolean;
@@ -220,13 +221,13 @@ export interface UserAuthorizationActions extends AuthorizationActions {
}
export interface UserSiteAuthorizationActions extends AuthorizationActions {
- canAssignToUser?: boolean;
- canUnassignFromUser?: boolean;
+ canAssignSitesToUser?: boolean;
+ canUnassignSitesFromUser?: boolean;
}
export interface SiteUserAuthorizationActions extends AuthorizationActions {
- canAssignToSite?: boolean;
- canUnassignFromSite?: boolean;
+ canAssignUsersToSite?: boolean;
+ canUnassignUsersFromSite?: boolean;
}
export interface TagAuthorizationActions extends AuthorizationActions {
@@ -258,14 +259,13 @@ export interface SiteAreaAuthorizationActions extends AuthorizationActions {
}
export interface SiteAuthorizationActions extends AuthorizationActions {
- canAssignUsers?: boolean;
- canUnassignUsers?: boolean;
- canAssignToUser?: boolean;
- canUnassignFromUser?: boolean;
+ canAssignUnassignUsers?: boolean;
canListSiteUsers?: boolean;
canExportOCPPParams?: boolean;
canGenerateQrCode?: boolean;
canMaintainPricingDefinitions?: boolean;
+ canAssignSitesToUser?: boolean;
+ canUnassignSitesFromUser?: boolean;
}
export type BillingTaxAuthorizationActions = AuthorizationActions;

aligned assign / unassign actions