Retrieve charging stations without auth (canXXX) for each record
MODIFY
src/assets/schemas/common/common.json
src/assets/schemas/common/common.json
"type": "boolean",
"sanitize": "mongo"
},
+ "withAuth": {
+ "type": "boolean",
+ "sanitize": "mongo"
+ },
"skip": {
"type": "number",
"sanitize": "mongo"

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstations-get.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstations-get.json
},
"ProjectFields": {
"$ref": "common#/definitions/projectFields"
+ },
+ "WithAuth": {
+ "$ref": "common#/definitions/withAuth",
+ "default": true
}
},
"required": [

MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -970,9 +970,10 @@ export default class ChargingStationService {
chargingStations.projectFields = authorizations.projectFields;
}
// Add Auth flags
+ if (filteredRequest.WithAuth) {
await AuthorizationService.addChargingStationsAuthorizations(
req.tenant, req.user, chargingStations, authorizations);
-
+ }
return chargingStations;
}

MODIFY
src/types/requests/HttpDatabaseRequest.ts
src/types/requests/HttpDatabaseRequest.ts
@@ -7,5 +7,6 @@ export default interface HttpDatabaseRequest extends HttpDatabaseProjectRequest
OnlyRecordCount?: boolean;
SortFields: any;
WithUser: boolean;
+ WithAuth: boolean;
}

Retrieve charging stations without auth (canXXX) for each record