mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-12 01:37:40 +02:00
Grant admins access to manage backup pages and features
Update permissions to allow 'admin' role access to the 'backups' module, enabling management operations, and modify the BackupManager component to reflect this new permission check. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/2HHgup2
This commit is contained in:
1 parent
b079d35e3a
commit
d68043c336
3 files changed
+21
-3
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
@@ -12,7 +12,9 @@ export type Module =
|
||||
| 'publicity'
|
||||
| 'customer-orders'
|
||||
| 'dlc'
|
||||
| 'tasks';
|
||||
| 'tasks'
|
||||
| 'admin'
|
||||
| 'backups';
|
||||
|
||||
// Définition des permissions par module et par rôle
|
||||
const PERMISSIONS: Record<Module, Record<Role, Permission[]>> = {
|
||||
@@ -86,6 +88,22 @@ const PERMISSIONS: Record<Module, Record<Role, Permission[]>> = {
|
||||
directeur: ['view', 'create', 'edit', 'delete', 'validate'],
|
||||
manager: ['view', 'validate'],
|
||||
employee: ['view']
|
||||
},
|
||||
|
||||
// Administration générale - Admin seulement
|
||||
admin: {
|
||||
admin: ['view', 'create', 'edit', 'delete', 'manage'],
|
||||
directeur: [],
|
||||
manager: [],
|
||||
employee: []
|
||||
},
|
||||
|
||||
// Sauvegardes - Admin seulement
|
||||
backups: {
|
||||
admin: ['view', 'create', 'edit', 'delete', 'manage'],
|
||||
directeur: [],
|
||||
manager: [],
|
||||
employee: []
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ export default function BackupManager() {
|
||||
const queryClient = useQueryClient();
|
||||
const [deletingBackup, setDeletingBackup] = useState<string | null>(null);
|
||||
|
||||
// Check permissions
|
||||
const canManageBackups = hasPermission(user?.role || '', 'admin', 'manage');
|
||||
// Check permissions - Seulement les admins peuvent gérer les sauvegardes
|
||||
const canManageBackups = hasPermission(user?.role || '', 'backups', 'manage');
|
||||
|
||||
// Fetch backup list
|
||||
const { data: backups = [], isLoading, error } = useQuery({
|
||||
|
||||
Reference in new issue
Block a user