Allow all users to create customer orders without role restrictions

Remove role-based access control checks for creating customer orders, granting all roles the ability to create them.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/sxyKRlS
This commit is contained in:
michaelschal committed 2025-08-12 14:05:38 +00:00
1 parent 25b937aa6a
commit 176f3acbc0
2 files changed
+2 -7

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

+2 -7
View File
@@ -1952,13 +1952,8 @@ RÉSUMÉ DU SCAN
const data = insertCustomerOrderSchema.parse(req.body);
console.log("Parsed data:", data);
// Check if user has access to the specified group
if (user.role !== 'admin') {
const userGroupIds = user.userGroups?.map((ug: any) => ug.groupId) || [];
if (!userGroupIds.includes(data.groupId)) {
return res.status(403).json({ message: "Access denied to this group" });
}
}
// REMOVED: All role restrictions - tous les rôles peuvent créer des commandes client
console.log("Creating customer order - no role restrictions:", { userId, userRole: user.role, groupId: data.groupId });
const customerOrder = await storage.createCustomerOrder({
...data,