mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Merge pull request #313 from R0m1k3/1.1
Expand administrative access to include additional user roles
This commit is contained in:
2 files changed
+1
-1
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
+1
-1
@@ -2063,7 +2063,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
app.get('/api/users', isAuthenticated, async (req: any, res) => {
|
||||
try {
|
||||
const user = await storage.getUserWithGroups(req.user.claims ? req.user.claims.sub : req.user.id);
|
||||
if (!user || user.role !== 'admin') {
|
||||
if (!user || !['admin', 'directeur', 'manager'].includes(user.role)) {
|
||||
return res.status(403).json({ message: "Access denied" });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user