mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-12 01:37:40 +02:00
4 files changed
+2977
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
File diff suppressed because it is too large.
Load diff
@@ -1645,6 +1645,11 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
return res.status(404).json({ message: "User not found" });
|
||||
}
|
||||
|
||||
// Check permissions for creating tasks
|
||||
if (!hasPermission(user.role, 'tasks', 'create')) {
|
||||
return res.status(403).json({ message: "Permission denied: cannot create tasks" });
|
||||
}
|
||||
|
||||
const data = {
|
||||
...req.body,
|
||||
createdBy: user.id,
|
||||
|
||||
@@ -80,11 +80,11 @@ const PERMISSIONS: Record<Module, Record<Role, Permission[]>> = {
|
||||
employee: ['view', 'create']
|
||||
},
|
||||
|
||||
// Tâches - Admin/Directeur tout, Manager view + validate, Employé view seulement
|
||||
// Tâches - Admin/Directeur tout, Manager view + create + edit + validate, Employé view seulement
|
||||
tasks: {
|
||||
admin: ['view', 'create', 'edit', 'delete', 'validate'],
|
||||
directeur: ['view', 'create', 'edit', 'delete', 'validate'],
|
||||
manager: ['view', 'validate'],
|
||||
manager: ['view', 'create', 'edit', 'validate'],
|
||||
employee: ['view']
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user