refactor: Remove dedicated role management page and update authentication, roles, and permission handling across backend and frontend.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user