Fixed Demo user cannot see sessions
MODIFY
src/authorization/Authorizations.ts
src/authorization/Authorizations.ts
@@ -102,6 +102,9 @@ export default class Authorizations {
if (!Utils.isComponentActiveFromToken(loggedUser, TenantComponents.ORGANIZATION)) {
return null;
}
+ if (this.isDemo(loggedUser)) {
+ return null;
+ }
if (this.isAdmin(loggedUser)) {
return requestedSites;
}

MODIFY
src/storage/mongodb/TransactionStorage.ts
src/storage/mongodb/TransactionStorage.ts
@@ -312,7 +312,6 @@ export default class TransactionStorage {
filterMatch.timestamp.$lte = Utils.convertToDate(params.endDateTime);
}
}
-
// OCPI Session Date provided?
if (params.ocpiSessionDateFrom || params.ocpiSessionDateTo) {
// Start date
@@ -328,7 +327,6 @@ export default class TransactionStorage {
filterMatch['ocpiData.session'] = { $exists: true };
filterMatch['ocpiData.sessionCheckedOn'] = { $exists: params.ocpiSessionChecked };
}
-
// OCPI Cdr Date provided?
if (params.ocpiCdrDateFrom || params.ocpiCdrDateTo) {
// Start date
@@ -344,7 +342,6 @@ export default class TransactionStorage {
filterMatch['ocpiData.cdr'] = { $exists: true };
filterMatch['ocpiData.cdrCheckedOn'] = { $exists: params.ocpiCdrChecked };
}
-
// Check stop transaction
if (params.stop) {
filterMatch.stop = params.stop;

Fixed Demo user cannot see sessions