mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-17 20:29:18 +02:00
Improve user editing, allowing admins access to all stores without assignment
Updates user editing logic to handle admin roles and store access, with schema changes. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/9d9e1107-c416-4124-a939-a91c612c56a1.jpg
This commit is contained in:
1 parent
bedb7bd4cc
commit
4dbdda2071
3 files changed
+39
-22
No files matched your search
+1
-1
@@ -295,7 +295,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
const userData = insertUserSchema.partial().parse(req.body);
|
||||
|
||||
// Protection spécifique pour le rôle seulement
|
||||
if (userData.role) {
|
||||
if (userData.role !== undefined) {
|
||||
// Protection : empêcher un admin de changer son propre rôle par accident
|
||||
if (userId === currentUser?.id && userData.role !== 'administrator') {
|
||||
return res.status(400).json({
|
||||
|
||||
Reference in new issue
Block a user