Remove Site ID from handleGetUserDefaultTagCar() endpoint
MODIFY
src/assets/server/rest/v1/schemas/user/user-get-default-tag-car.json
src/assets/server/rest/v1/schemas/user/user-get-default-tag-car.json
"UserID": {
"$ref": "common.json#/definitions/id"
},
- "SiteID": {
- "$ref": "common.json#/definitions/id"
- },
"ProjectFields": {
"$ref": "common.json#/definitions/projectFields"
}
},
"required": [
- "UserID", "SiteID"
+ "UserID"
]
}

MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -36,7 +36,6 @@ import SiteAreaStorage from '../../../../storage/mongodb/SiteAreaStorage';
import SiteStorage from '../../../../storage/mongodb/SiteStorage';
import SmartChargingFactory from '../../../../integration/smart-charging/SmartChargingFactory';
import { StatusCodes } from 'http-status-codes';
-import Tag from '../../../../types/Tag';
import TagStorage from '../../../../storage/mongodb/TagStorage';
import Tenant from '../../../../types/Tenant';
import TenantComponents from '../../../../types/TenantComponents';
@@ -1208,7 +1207,7 @@ export default class ChargingStationService {
}
// Check and Get User
const user = await UtilsService.checkAndGetUserAuthorization(
- req.tenant, req.user, filteredRequest.args.userID, Action.READ, action, {});
+ req.tenant, req.user, filteredRequest.args.userID, Action.READ, action);
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
UtilsService.assertObjectExists(action, user, `User ID '${filteredRequest.args.userID}' does not exist`,
MODULE_NAME, 'handleAction', req.user);

MODIFY
src/server/rest/v1/service/UserService.ts
src/server/rest/v1/service/UserService.ts
@@ -82,11 +82,8 @@ export default class UserService {
const errorCodes: Array<StartTransactionErrorCode> = [];
// Check Billing errors
await UserService.checkBillingErrorCodes(action, req.tenant, req.user, user, errorCodes);
- // Get authorization filters for users
- const authorizationUsersFilters = await AuthorizationService.checkAndGetUsersAuthorizationFilters(
- req.tenant, req.user, { SiteID: filteredRequest.SiteID });
res.json({
- tag, car, errorCodes, canListUsers: authorizationUsersFilters.authorized
+ tag, car, errorCodes
});
next();
}

MODIFY
src/types/requests/HttpUserRequest.ts
src/types/requests/HttpUserRequest.ts
@@ -100,5 +100,4 @@ export interface HttpEulaRequest {
export interface HttpUserDefaultTagCar {
UserID: string;
- SiteID: string;
}

Remove Site ID from handleGetUserDefaultTagCar() endpoint