mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-15 11:19:43 +02:00
Grant task creation permissions to managers
Update shared/permissions.ts to add 'create' permission to manager role for tasks module. Also, add a permission check in server/routes.ts before creating a task. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6 Replit-Commit-Checkpoint-Type: full_checkpoint
This commit is contained in:
1 parent
6db69c8c94
commit
989b2c8c40
2 files changed
+7
-2
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user