mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-26 08:15:25 +02:00
refactor(roles): streamline role permissions handling
- Refactored role permissions management by importing specific permissions directly instead of querying the database. - Updated the `getDefaultRoles` method to return predefined permissions for owner, admin, and member roles. - Simplified the permissions structure in the RBAC schema for better clarity and maintainability.
This commit is contained in:
@@ -54,13 +54,15 @@ export const PERMISSIONS = {
|
||||
},
|
||||
} as const;
|
||||
|
||||
const getAllPermissionNames = () => {
|
||||
return Object.values(PERMISSIONS).flatMap((category) =>
|
||||
Object.values(category).map((permission) => permission.name),
|
||||
);
|
||||
};
|
||||
|
||||
export const ownerPermissions = getAllPermissionNames();
|
||||
export const ownerPermissions = [
|
||||
PERMISSIONS.PROJECT.VIEW.name,
|
||||
PERMISSIONS.PROJECT.CREATE.name,
|
||||
PERMISSIONS.PROJECT.DELETE.name,
|
||||
PERMISSIONS.SERVICE.VIEW.name,
|
||||
PERMISSIONS.SERVICE.CREATE.name,
|
||||
PERMISSIONS.SERVICE.DELETE.name,
|
||||
PERMISSIONS.TRAEFIK.ACCESS.name,
|
||||
];
|
||||
|
||||
export const adminPermissions = [
|
||||
PERMISSIONS.PROJECT.VIEW.name,
|
||||
|
||||
Reference in New Issue
Block a user