refactor: enhance role management UI and integrate profile management features
- Introduced a modal for managing user profiles, allowing for the creation and editing of profiles with improved state management. - Updated the role filtering logic to enhance type safety and readability. - Refactored UI components for better user experience, including improved button states and loading indicators. - Removed outdated code related to permissions and streamlined the overall structure for maintainability.
This commit is contained in:
@@ -366,32 +366,6 @@ export default defineSchema({
|
||||
.index("by_role", ["roleId"])
|
||||
.index("by_permissao", ["permissaoId"]),
|
||||
|
||||
// Permissões de Menu (granulares por role)
|
||||
menuPermissoes: defineTable({
|
||||
roleId: v.id("roles"),
|
||||
menuPath: v.string(), // "/recursos-humanos", "/financeiro", etc.
|
||||
podeAcessar: v.boolean(),
|
||||
podeConsultar: v.boolean(), // Pode apenas visualizar
|
||||
podeGravar: v.boolean(), // Pode criar/editar/excluir
|
||||
})
|
||||
.index("by_role", ["roleId"])
|
||||
.index("by_menu", ["menuPath"])
|
||||
.index("by_role_and_menu", ["roleId", "menuPath"]),
|
||||
|
||||
// Permissões de Menu Personalizadas (por matrícula)
|
||||
menuPermissoesPersonalizadas: defineTable({
|
||||
usuarioId: v.id("usuarios"),
|
||||
matricula: v.string(), // Para facilitar busca
|
||||
menuPath: v.string(),
|
||||
podeAcessar: v.boolean(),
|
||||
podeConsultar: v.boolean(),
|
||||
podeGravar: v.boolean(),
|
||||
})
|
||||
.index("by_usuario", ["usuarioId"])
|
||||
.index("by_matricula", ["matricula"])
|
||||
.index("by_usuario_and_menu", ["usuarioId", "menuPath"])
|
||||
.index("by_matricula_and_menu", ["matricula", "menuPath"]),
|
||||
|
||||
sessoes: defineTable({
|
||||
usuarioId: v.id("usuarios"),
|
||||
token: v.string(),
|
||||
@@ -473,20 +447,7 @@ export default defineSchema({
|
||||
.index("by_data_inicio", ["dataInicio"]),
|
||||
|
||||
// Perfis Customizados
|
||||
perfisCustomizados: defineTable({
|
||||
nome: v.string(),
|
||||
descricao: v.string(),
|
||||
nivel: v.number(), // >= 3
|
||||
roleId: v.id("roles"), // role correspondente criada
|
||||
criadoPor: v.id("usuarios"), // TI_MASTER que criou
|
||||
criadoEm: v.number(),
|
||||
atualizadoEm: v.number(),
|
||||
})
|
||||
.index("by_nome", ["nome"])
|
||||
.index("by_nivel", ["nivel"])
|
||||
.index("by_criado_por", ["criadoPor"])
|
||||
.index("by_role", ["roleId"]),
|
||||
|
||||
|
||||
// Templates de Mensagens
|
||||
templatesMensagens: defineTable({
|
||||
codigo: v.string(), // "USUARIO_BLOQUEADO", "SENHA_RESETADA", etc.
|
||||
|
||||
Reference in New Issue
Block a user