mirror of
https://github.com/dadosfera/maestro.git
synced 2026-09-10 21:44:48 +00:00
FIX: sending access token to role function to evaluate editing permissions
This commit is contained in:
@@ -136,10 +136,18 @@ export function EnrichErrorCode(code: string) {
|
||||
code,
|
||||
};
|
||||
case ErrorCodes.ROLE.NOT_FOUND:
|
||||
case ErrorCodes.ROLE.FROM_ANOTHER_CUSTOMER:
|
||||
return {
|
||||
statusCode: HttpStatus.NOT_FOUND,
|
||||
error: 'Grupo não encontrado',
|
||||
message: 'Grupo solicitado não encontrado',
|
||||
code: ErrorCodes.ROLE.NOT_FOUND,
|
||||
};
|
||||
case ErrorCodes.ROLE.CANNOT_EDIT_PUBLIC_ROLE:
|
||||
return {
|
||||
statusCode: HttpStatus.FORBIDDEN,
|
||||
error: 'Grupo público',
|
||||
message: 'Você não tem permissão para editar esse grupo',
|
||||
code,
|
||||
};
|
||||
case ErrorCodes.USER.NOT_FOUND:
|
||||
|
||||
@@ -16,6 +16,8 @@ export const AUTH = {
|
||||
export const ROLE = {
|
||||
ALREADY_EXIST: 'ROLE.ALREADY_EXISTS',
|
||||
NOT_FOUND: 'ROLE.NOT_FOUND',
|
||||
FROM_ANOTHER_CUSTOMER: 'ROLE.FROM_ANOTHER_CUSTOMER',
|
||||
CANNOT_EDIT_PUBLIC_ROLE: 'ROLE.CANNOT_EDIT_PUBLIC_ROLE',
|
||||
};
|
||||
|
||||
export const USER = {
|
||||
|
||||
Reference in New Issue
Block a user