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:
Mauricio Siu
2025-07-12 23:45:06 -06:00
parent 509d95fbf2
commit d78e634cb0
4 changed files with 15 additions and 70 deletions

View File

@@ -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;