refactor: update permissions and clean up Svelte component
- Removed outdated information about the permissions system from the Svelte component. - Added new actions for resource management in the backend, including 'aprovar_ausencias' and 'aprovar_ferias'. - Cleaned up console logs in the user retrieval function for better performance and security.
This commit is contained in:
@@ -8,7 +8,16 @@ import { getCurrentUserFunction } from './auth';
|
||||
export const CATALOGO_RECURSOS = [
|
||||
{
|
||||
recurso: 'funcionarios',
|
||||
acoes: ['dashboard', 'ver', 'listar', 'criar', 'editar', 'excluir']
|
||||
acoes: [
|
||||
'dashboard',
|
||||
'ver',
|
||||
'listar',
|
||||
'criar',
|
||||
'editar',
|
||||
'excluir',
|
||||
'aprovar_ausencias',
|
||||
'aprovar_ferias'
|
||||
]
|
||||
},
|
||||
{
|
||||
recurso: 'simbolos',
|
||||
|
||||
@@ -562,15 +562,12 @@ export const obterPerfil = query({
|
||||
),
|
||||
handler: async (ctx) => {
|
||||
const usuarioAutenticado = await getCurrentUserFunction(ctx);
|
||||
console.log('Usuario autenticado:', usuarioAutenticado);
|
||||
if (!usuarioAutenticado) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const usuarioAtual = usuarioAutenticado;
|
||||
|
||||
console.log('✅ Usuário encontrado:', usuarioAtual.nome);
|
||||
|
||||
// Buscar fotoPerfil URL se existir
|
||||
let fotoPerfilUrl = null;
|
||||
if (usuarioAtual.fotoPerfil) {
|
||||
|
||||
Reference in New Issue
Block a user