mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-14 18:59:18 +02:00
Merge pull request #38 from R0m1k3/1.1
Allow all users to create customer orders without role restrictions
This commit is contained in:
2 files changed
+2
-7
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 307 KiB |
+2
-7
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user