Added users in AuthDef for TagService
MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -105,7 +105,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
resource: Entity.TAGS, action: Action.LIST,
attributes: [
'id', 'userID', 'active', 'ocpiToken', 'description', 'visualID', 'issuer', 'default',
- 'createdOn', 'lastChangedOn'
+ 'user.name', 'user.firstName', 'user.email', 'createdOn', 'lastChangedOn'
]
},
{ resource: Entity.TAGS, action: [Action.IMPORT, Action.EXPORT] },

MODIFY
src/server/rest/v1/service/TagService.ts
src/server/rest/v1/service/TagService.ts
@@ -741,9 +741,8 @@ export default class TagService {
// Get authorization filters for users
const authorizationUsersFilters = await AuthorizationService.checkAndGetUsersAuthorizationFilters(
req.tenant, req.user, {});
- if (authorizationUsersFilters.authorized) {
- authorizationTagsFilters.projectFields.push('userID', 'user.id', 'user.name', 'user.firstName', 'user.email',
- 'createdBy.name', 'createdBy.firstName', 'lastChangedBy.name', 'lastChangedBy.firstName');
+ if (!authorizationUsersFilters.authorized) {
+ return Constants.DB_EMPTY_DATA_RESULT;
}
// Get the tags
const tags = await TagStorage.getTags(req.user.tenantID,

Added users in AuthDef for TagService