Always try to get the user when no acl
MODIFY
src/authorization/Authorizations.ts
src/authorization/Authorizations.ts
@@ -652,6 +652,7 @@ export default class Authorizations {
private static async isTagIDAuthorizedOnChargingStation(tenantID: string, chargingStation: ChargingStation,
transaction: Transaction, tagID: string, action: Action): Promise<User> {
+ let user: User = null;
// Get the Organization component
const tenant = await TenantStorage.getTenant(tenantID);
const isOrgCompActive = Utils.isTenantComponentActive(tenant, TenantComponents.ORGANIZATION);
@@ -680,8 +681,11 @@ export default class Authorizations {
}
// Access Control Enabled?
if (!chargingStation.siteArea.accessControl) {
- // No control
- return;
+ // No ACL: Always try to get the user
+ if (tagID) {
+ user = await UserStorage.getUserByTagId(tenantID, tagID);
+ }
+ return user;
}
// Site -----------------------------------------------------
chargingStation.siteArea.site = chargingStation.siteArea.site ?
@@ -697,8 +701,6 @@ export default class Authorizations {
});
}
}
- // Get user
- let user: User = null;
// Get the user
if (tagID) {
user = await Authorizations.checkAndGetUserTagIDOnChargingStation(

Always try to get the user when no acl