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

@@ -1,6 +1,6 @@
import type { Id } from '@sgse-app/backend/convex/betterAuth/_generated/dataModel';
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import type { Id } from '@sgse-app/backend/convex/_generated/dataModel';
interface Usuario {
_id: string;
@@ -11,8 +11,7 @@ interface Usuario {
role: {
_id: string;
nome: string;
nivel: number;
setor?: string;
admin?: boolean;
};
primeiroAcesso: boolean;
avatar?: string;
@@ -56,7 +55,7 @@ class AuthStore {
}
get isAdmin() {
return this.state.usuario?.role.nivel === 0;
return this.state.usuario?.role.admin === true;
}
get isTI() {