Expand admin access to include overseer and employee roles

Update the isAdmin check in server/routes.ts to include 'oversee' and 'employee' roles in addition to 'admin' for administrative access.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 53205cf3-ee26-42f0-98cc-9723a1b69ba3
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/gDYUPHL
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sirpiglr 2025-12-17 02:53:10 +00:00
parent 8de4a46ee7
commit 05b06519c7

View file

@ -64,7 +64,7 @@ export async function registerRoutes(
const profile = await storage.getProfile(data.user.id);
// Check if user is admin (based on profile role or email)
const isAdmin = profile?.role === 'admin' || email.includes('admin');
const isAdmin = ['admin', 'oversee', 'employee'].includes(profile?.role || '') || email.includes('admin');
// Set express session
req.session.regenerate((err) => {