Add canCreate flag.
MODIFY
src/server/rest/v1/service/AuthorizationService.ts
src/server/rest/v1/service/AuthorizationService.ts
@@ -431,9 +431,9 @@ export default class AuthorizationService {
}
public static async addTagsAuthorizations(tenant: Tenant, userToken: UserToken, tags: TagDataResult,
- authorizationFilter: AuthorizationFilter, filteredRequest: HttpTagsRequest): Promise<void> {
- // // Add canCreate flag to root
- // tags.canCreate = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.TAG, Action.CREATE, authorizationFilter);
+ authorizationFilter: AuthorizationFilter): Promise<void> {
+ // Add canCreate flag to root
+ tags.canCreate = await AuthorizationService.canPerformAuthorizationAction(tenant, userToken, Entity.TAG, Action.CREATE, authorizationFilter);
// Enrich
for (const tag of tags.result) {
await AuthorizationService.addTagAuthorizations(tenant, userToken, tag, authorizationFilter);

MODIFY
src/server/rest/v1/service/TagService.ts
src/server/rest/v1/service/TagService.ts
@@ -737,8 +737,7 @@ export default class TagService {
authorizationTagsFilters.projectFields,
);
// Add Auth flags
- await AuthorizationService.addTagsAuthorizations(req.tenant, req.user, tags as TagDataResult,
- authorizationUsersFilters, filteredRequest);
+ await AuthorizationService.addTagsAuthorizations(req.tenant, req.user, tags as TagDataResult, authorizationUsersFilters);
// Return
return tags;
}

Add canCreate flag.