refactor: Remove dedicated role management page and update authentication, roles, and permission handling across backend and frontend.

This commit is contained in:
2025-12-05 14:29:34 -03:00
parent c8d717b315
commit 69f32a342c
16 changed files with 358 additions and 958 deletions

View File

@@ -4,7 +4,7 @@ import { getCurrentUserFunction } from './auth';
/**
* Retorna as permissões do usuário atual para o frontend filtrar o menu localmente
* Retorna:
* - isMaster: true se o usuário é TI Master ou Admin (nível <= 1)
* - isMaster: true se o usuário é Admin
* - permissions: Set de strings no formato "recurso.acao" (ex: "funcionarios.listar")
*/
export const getUserPermissions = query({
@@ -20,8 +20,8 @@ export const getUserPermissions = query({
return { isMaster: false, permissions: [] };
}
// Se for TI Master ou Admin (nivel <= 1), retorna flag de master
if (role.nivel <= 1) {
// Se for Admin, retorna flag de master
if (role.admin === true) {
return { isMaster: true, permissions: [] };
}