mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-08 07:25:22 +02:00
refactor(sidebar): clean up unused types and improve menu structure
- Removed legacy comments and unused type definitions from the sidebar component for better clarity. - Added role information to user queries in the user router to enhance permission handling. - Introduced a new schedule access permission in the RBAC schema and updated role permissions accordingly. - Enhanced error messages in role management functions for improved user feedback.
This commit is contained in:
@@ -59,7 +59,7 @@ export const removeRoleById = async (roleId: string) => {
|
||||
});
|
||||
|
||||
if (members.length > 0) {
|
||||
throw new Error("Cannot delete role with members");
|
||||
throw new Error("Cannot delete role with assigned members");
|
||||
}
|
||||
|
||||
await db.delete(role).where(eq(role.roleId, roleId));
|
||||
@@ -77,6 +77,10 @@ export const updateRoleById = async (
|
||||
throw new Error("Role not found");
|
||||
}
|
||||
|
||||
if (currentRole.isSystem) {
|
||||
throw new Error("Cannot update system role");
|
||||
}
|
||||
|
||||
await db.update(role).set(input).where(eq(role.roleId, roleId));
|
||||
|
||||
return currentRole;
|
||||
|
||||
Reference in New Issue
Block a user