Enforce check on the issuer in Tag, User, Site, Site Area, Company, Chargers, Assigments...
MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
@@ -49,13 +49,24 @@ export default class ChargingStationService {
// Check the Charging Station
const chargingStation = await ChargingStationStorage.getChargingStation(req.user.tenantID, filteredRequest.id);
UtilsService.assertObjectExists(action, chargingStation, `Charging Station '${filteredRequest.id}' does not exist.`,
- MODULE_NAME, 'handleAssignChargingStationsToSiteArea', req.user);
+ MODULE_NAME, 'handleUpdateChargingStationParams', req.user);
+ // OCPI Charging Station
+ if (!chargingStation.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Charging Station '${chargingStation.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateChargingStationParams',
+ user: req.user,
+ action: action
+ });
+ }
let siteArea: SiteArea = null;
// Check the Site Area
if (Utils.isComponentActiveFromToken(req.user, TenantComponents.ORGANIZATION) && filteredRequest.siteAreaID) {
siteArea = await SiteAreaStorage.getSiteArea(req.user.tenantID, filteredRequest.siteAreaID);
UtilsService.assertObjectExists(action, siteArea, `Site Area '${filteredRequest.siteAreaID}' does not exist.`,
- MODULE_NAME, 'handleAssignChargingStationsToSiteArea', req.user);
+ MODULE_NAME, 'handleUpdateChargingStationParams', req.user);
}
// Check Auth
if (!Authorizations.canUpdateChargingStation(req.user, siteArea ? siteArea.siteID : null)) {
@@ -106,6 +117,17 @@ export default class ChargingStationService {
}
// Update Site Area
if (siteArea) {
+ // OCPI Site Area
+ if (!siteArea.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site Area '${siteArea.name}' with ID '${siteArea.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateChargingStationParams',
+ user: req.user,
+ action: action
+ });
+ }
chargingStation.siteAreaID = siteArea.id;
// Check number of phases corresponds to the site area one
if (filteredRequest.connectors) {
@@ -416,8 +438,19 @@ export default class ChargingStationService {
const filteredRequest = ChargingStationSecurity.filterChargingProfileUpdateRequest(req.body);
// Check existence
const chargingStation = await ChargingStationStorage.getChargingStation(req.user.tenantID, filteredRequest.chargingStationID);
- UtilsService.assertObjectExists(action, chargingStation, `ChargingStation '${req.body.ChargingStationID}' does not exist.`,
+ UtilsService.assertObjectExists(action, chargingStation, `ChargingStation '${filteredRequest.chargingStationID}' does not exist.`,
MODULE_NAME, 'handleUpdateChargingProfile', req.user);
+ // OCPI Charging Station
+ if (!chargingStation.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Charging Station '${chargingStation.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateChargingProfile',
+ user: req.user,
+ action: action
+ });
+ }
const chargePoint = Utils.getChargePointFromID(chargingStation, filteredRequest.chargePointID);
UtilsService.assertObjectExists(action, chargePoint, `Charge Point '${filteredRequest.chargePointID}' does not exist.`,
MODULE_NAME, 'handleUpdateChargingProfile', req.user);
@@ -470,6 +503,17 @@ export default class ChargingStationService {
const chargingStation = await ChargingStationStorage.getChargingStation(req.user.tenantID, chargingProfile.chargingStationID);
UtilsService.assertObjectExists(action, chargingStation, `ChargingStation '${chargingProfile.chargingStationID}' does not exist.`,
MODULE_NAME, 'handleDeleteChargingProfile', req.user);
+ // OCPI Charging Station
+ if (!chargingStation.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Charging Station '${chargingStation.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleDeleteChargingProfile',
+ user: req.user,
+ action: action
+ });
+ }
// Check Component
let siteID = null;
if (Utils.isComponentActiveFromToken(req.user, TenantComponents.ORGANIZATION)) {
@@ -573,9 +617,19 @@ export default class ChargingStationService {
'handleDeleteChargingStation', req.user);
// Get
const chargingStation = await ChargingStationStorage.getChargingStation(req.user.tenantID, chargingStationID);
- // Check
UtilsService.assertObjectExists(action, chargingStation, `Charging Station with ID '${chargingStationID}' does not exist`,
MODULE_NAME, 'handleDeleteChargingStation', req.user);
+ // OCPI Charging Station
+ if (!chargingStation.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Charging Station '${chargingStation.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleDeleteChargingStation',
+ user: req.user,
+ action: action
+ });
+ }
let siteID = null;
if (Utils.isComponentActiveFromToken(req.user, TenantComponents.ORGANIZATION)) {
// Get the Site Area

MODIFY
src/server/rest/service/CompanyService.ts
src/server/rest/service/CompanyService.ts
import { Action, Entity } from '../../../types/Authorization';
+import { HTTPAuthError, HTTPError } from '../../../types/HTTPError';
import { NextFunction, Request, Response } from 'express';
import AppAuthError from '../../../exception/AppAuthError';
+import AppError from '../../../exception/AppError';
import Authorizations from '../../../authorization/Authorizations';
import Company from '../../../types/Company';
import CompanySecurity from './security/CompanySecurity';
import CompanyStorage from '../../../storage/mongodb/CompanyStorage';
import Constants from '../../../utils/Constants';
-import { HTTPAuthError } from '../../../types/HTTPError';
import Logging from '../../../utils/Logging';
import { ServerAction } from '../../../types/Server';
import TenantComponents from '../../../types/TenantComponents';
@@ -38,9 +39,19 @@ export default class CompanyService {
}
// Get
const company = await CompanyStorage.getCompany(req.user.tenantID, companyID);
- // Found?
UtilsService.assertObjectExists(action, company, `Company with ID '${companyID}' does not exist`,
MODULE_NAME, 'handleDeleteCompany', req.user);
+ // OCPI Company
+ if (!company.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Company '${company.name}' with ID '${company.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleDeleteCompany',
+ user: req.user,
+ action: action
+ });
+ }
// Delete
await CompanyStorage.deleteCompany(req.user.tenantID, company.id);
// Log
@@ -211,6 +222,17 @@ export default class CompanyService {
MODULE_NAME, 'handleUpdateCompany', req.user);
// Check Mandatory fields
Utils.checkIfCompanyValid(filteredRequest, req);
+ // OCPI Company
+ if (!company.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Company '${company.name}' with ID '${company.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateCompany',
+ user: req.user,
+ action: action
+ });
+ }
// Update
company.name = filteredRequest.name;
company.address = filteredRequest.address;

MODIFY
src/server/rest/service/SiteAreaService.ts
src/server/rest/service/SiteAreaService.ts
@@ -59,6 +59,17 @@ export default class SiteAreaService {
value: filteredRequest.siteAreaID
});
}
+ // OCPI Site Area
+ if (!siteArea.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site Area '${siteArea.name}' with ID '${siteArea.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignAssetsToSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
// Get Assets
for (const assetID of filteredRequest.assetIDs) {
// Check the asset
@@ -119,6 +130,17 @@ export default class SiteAreaService {
const siteArea = await SiteAreaStorage.getSiteArea(req.user.tenantID, filteredRequest.siteAreaID);
UtilsService.assertObjectExists(action, siteArea, `Site Area '${filteredRequest.siteAreaID}' does not exist`,
MODULE_NAME, 'handleAssignChargingStationsToSiteArea', req.user);
+ // OCPI Site Area
+ if (!siteArea.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site Area '${siteArea.name}' with ID '${siteArea.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignChargingStationsToSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
// Check auth
if (!Authorizations.canUpdateSiteArea(req.user, siteArea.siteID)) {
throw new AppAuthError({
@@ -145,6 +167,17 @@ export default class SiteAreaService {
value: chargingStationID
});
}
+ // OCPI Charging Station
+ if (!chargingStation.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Charging Station '${chargingStation.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignChargingStationsToSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
for (const connector of chargingStation.connectors) {
const chargePoint = Utils.getChargePointFromID(chargingStation, connector.chargePointID);
const numberOfConnectedPhase = Utils.getNumberOfConnectedPhases(chargingStation, chargePoint, connector.connectorId);
@@ -201,6 +234,17 @@ export default class SiteAreaService {
value: siteAreaID
});
}
+ // OCPI Site Area
+ if (!siteArea.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site Area '${siteArea.name}' with ID '${siteArea.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
// Delete
await SiteAreaStorage.deleteSiteArea(req.user.tenantID, siteArea.id);
// Log
@@ -391,7 +435,18 @@ export default class SiteAreaService {
const site = await SiteStorage.getSite(req.user.tenantID, filteredRequest.siteID);
UtilsService.assertObjectExists(action, site, `Site ID '${filteredRequest.siteID}' does not exist`,
MODULE_NAME, 'handleCreateSiteArea', req.user);
- // Create site
+ // OCPI Site
+ if (!site.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site '${site.name}' with ID '${site.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleCreateSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
+ // Create Site Area
const newSiteArea: SiteArea = {
...filteredRequest,
issuer: true,
@@ -422,6 +477,17 @@ export default class SiteAreaService {
const siteArea = await SiteAreaStorage.getSiteArea(req.user.tenantID, filteredRequest.id, { withChargingStations: true });
UtilsService.assertObjectExists(action, siteArea, `Site Area with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleUpdateSiteArea', req.user);
+ // OCPI Site Area
+ if (!siteArea.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site Area '${siteArea.name}' with ID '${siteArea.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
// Check auth
if (!Authorizations.canUpdateSiteArea(req.user, siteArea.siteID)) {
throw new AppAuthError({
@@ -438,6 +504,17 @@ export default class SiteAreaService {
const site = await SiteStorage.getSite(req.user.tenantID, filteredRequest.siteID);
UtilsService.assertObjectExists(action, site, `Site ID '${filteredRequest.siteID}' does not exist`,
MODULE_NAME, 'handleUpdateSiteArea', req.user);
+ // OCPI Site
+ if (!site.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site '${site.name}' with ID '${site.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleCreateSiteArea',
+ user: req.user,
+ action: action
+ });
+ }
// Update
siteArea.name = filteredRequest.name;
siteArea.address = filteredRequest.address;

MODIFY
src/server/rest/service/SiteService.ts
src/server/rest/service/SiteService.ts
@@ -201,6 +201,17 @@ export default class SiteService {
const site = await SiteStorage.getSite(req.user.tenantID, filteredRequest.siteID);
UtilsService.assertObjectExists(action, site, `Site '${filteredRequest.siteID}' does not exist`,
MODULE_NAME, 'handleAssignUsersToSite', req.user);
+ // OCPI Site
+ if (!site.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site '${site.name}' with ID '${site.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignUsersToSite',
+ user: req.user,
+ action: action
+ });
+ }
// Get Users
for (const userID of filteredRequest.userIDs) {
// Check the user
@@ -217,6 +228,17 @@ export default class SiteService {
value: userID
});
}
+ // OCPI User
+ if (!user.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `User '${Utils.buildUserFullName(user)}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignUsersToSite',
+ user: req.user, actionOnUser: user,
+ action: action
+ });
+ }
}
// Save
if (action === ServerAction.ADD_USERS_TO_SITE) {
@@ -313,6 +335,17 @@ export default class SiteService {
const site = await SiteStorage.getSite(req.user.tenantID, siteID);
UtilsService.assertObjectExists(action, site, `Site with ID '${siteID}' does not exist`,
MODULE_NAME, 'handleDeleteSite', req.user);
+ // OCPI Site
+ if (!site.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site '${site.name}' with ID '${site.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleDeleteSite',
+ user: req.user,
+ action: action
+ });
+ }
// Delete
await SiteStorage.deleteSite(req.user.tenantID, site.id);
// Log
@@ -453,6 +486,17 @@ export default class SiteService {
const company = await CompanyStorage.getCompany(req.user.tenantID, filteredRequest.companyID);
UtilsService.assertObjectExists(action, company, `Company ID '${filteredRequest.companyID}' does not exist`,
MODULE_NAME, 'handleCreateSite', req.user);
+ // OCPI Company
+ if (!company.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Company '${company.name}' with ID '${company.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleCreateSite',
+ user: req.user,
+ action: action
+ });
+ }
// Create site
const site: Site = {
...filteredRequest,
@@ -497,10 +541,32 @@ export default class SiteService {
const company = await CompanyStorage.getCompany(req.user.tenantID, filteredRequest.companyID);
UtilsService.assertObjectExists(action, company, `Company ID '${filteredRequest.companyID}' does not exist`,
MODULE_NAME, 'handleUpdateSite', req.user);
+ // OCPI Company
+ if (!company.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Company '${company.name}' with ID '${company.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleCreateSite',
+ user: req.user,
+ action: action
+ });
+ }
// Get Site
const site: Site = await SiteStorage.getSite(req.user.tenantID, filteredRequest.id);
UtilsService.assertObjectExists(action, site, `Site with ID '${filteredRequest.id}' does not exist`,
MODULE_NAME, 'handleUpdateSite', req.user);
+ // OCPI Site
+ if (!company.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site '${site.name}' with ID '${site.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleUpdateSite',
+ user: req.user,
+ action: action
+ });
+ }
// Update
site.lastChangedBy = { 'id': req.user.id };
site.lastChangedOn = new Date();

MODIFY
src/server/rest/service/UserService.ts
src/server/rest/service/UserService.ts
@@ -75,6 +75,28 @@ export default class UserService {
const user = await UserStorage.getUser(req.user.tenantID, filteredRequest.userID);
UtilsService.assertObjectExists(action, user, `User '${filteredRequest.userID}' does not exist`,
MODULE_NAME, 'handleAssignSitesToUser', req.user);
+ // Deleted
+ if (user.deleted) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ action: action,
+ errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
+ module: MODULE_NAME, method: 'handleAssignSitesToUser',
+ user: req.user
+ });
+ }
+ // OCPI User
+ if (!user.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `User '${Utils.buildUserFullName(user)}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignSitesToUser',
+ user: req.user, actionOnUser: user,
+ action: action
+ });
+ }
// Get Sites
for (const siteID of filteredRequest.siteIDs) {
const site = await SiteStorage.getSite(req.user.tenantID, siteID);
@@ -90,6 +112,17 @@ export default class UserService {
value: siteID
});
}
+ // OCPI Site
+ if (!site.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `Site '${site.name}' with ID '${site.id}' not issued by the organization`,
+ module: MODULE_NAME, method: 'handleAssignSitesToUser',
+ user: req.user,
+ action: action
+ });
+ }
}
// Save
if (action.toLowerCase().includes('add')) {
@@ -153,7 +186,7 @@ export default class UserService {
source: Constants.CENTRAL_SERVER,
action: action,
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
- message: `User with ID '${id}' is already deleted`,
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
module: MODULE_NAME, method: 'handleDeleteUser',
user: req.user
});
@@ -163,7 +196,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.GENERAL_ERROR,
- message: `User '${Utils.buildUserFullName(user)}' not issued by the organization cannot be deleted`,
+ message: `User '${Utils.buildUserFullName(user)}' not issued by the organization`,
module: MODULE_NAME, method: 'handleDeleteUser',
user: req.user, actionOnUser: user,
action: action
@@ -351,7 +384,18 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
- message: `User with ID '${filteredRequest.id}' is logically deleted`,
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
+ module: MODULE_NAME, method: 'handleUpdateUser',
+ user: req.user,
+ action: action
+ });
+ }
+ // OCPI User
+ if (!user.issuer) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: `User '${Utils.buildUserFullName(user)}' not issued by the organization`,
module: MODULE_NAME, method: 'handleUpdateUser',
user: req.user,
action: action
@@ -503,7 +547,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
- message: `User with ID '${filteredRequest.id}' is logically deleted`,
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
module: MODULE_NAME, method: 'handleUpdateUserMobileToken',
user: req.user,
action: action
@@ -555,7 +599,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
- message: `User with ID '${userID}' is logically deleted`,
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
module: MODULE_NAME, method: 'handleGetUser',
user: req.user,
action: action
@@ -592,7 +636,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
- message: `User with ID '${userID}' is logically deleted`,
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
module: MODULE_NAME, method: 'handleGetUserImage',
user: req.user,
action: action
@@ -811,7 +855,6 @@ export default class UserService {
}
}
}
-
if (Authorizations.isAdmin(req.user) || Authorizations.isSuperAdmin(req.user)) {
// Save User Status
if (filteredRequest.status) {
@@ -895,9 +938,9 @@ export default class UserService {
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.OBJECT_DOES_NOT_EXIST_ERROR,
module: MODULE_NAME, method: 'handleGetUserInvoice',
+ message: `User '${Utils.buildUserFullName(user)}' is logically deleted`,
action: action,
user: req.user,
- message: `User with ID '${id}' is logically deleted`,
});
}
// Get the settings
@@ -1066,7 +1109,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.GENERAL_ERROR,
- message: `Tag ID '${tag.id}' not issued by the organization cannot be deleted`,
+ message: `Tag ID '${tag.id}' not issued by the organization`,
module: MODULE_NAME, method: 'handleDeleteTag',
user: req.user,
action: action
@@ -1159,7 +1202,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.GENERAL_ERROR,
- message: `User ID '${user.id}' not issued by the organization cannot be assigned to Tag ID '${tag.id}'`,
+ message: `User '${Utils.buildUserFullName(user)}' not issued by the organization cannot be assigned to Tag ID '${tag.id}'`,
module: MODULE_NAME, method: 'handleCreateTag',
user: req.user,
action: action
@@ -1253,7 +1296,7 @@ export default class UserService {
throw new AppError({
source: Constants.CENTRAL_SERVER,
errorCode: HTTPError.GENERAL_ERROR,
- message: `User ID '${user.id}' not issued by the organization cannot be assigned to Tag ID '${tag.id}'`,
+ message: `User '${Utils.buildUserFullName(user)}' not issued by the organization cannot be assigned to Tag ID '${tag.id}'`,
module: MODULE_NAME, method: 'handleUpdateTag',
user: req.user,
action: action

Enforce check on the issuer in Tag, User, Site, Site Area, Company, Chargers, Assigments...