Merge pull request #38 from R0m1k3/1.1

Allow all users to create customer orders without role restrictions
This commit is contained in:
LogiFlow authored and GitHub committed 2025-08-12 16:06:31 +02:00
commit 599ada0ce8
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,