Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend: creating a user management admin #136

Open
arath7 opened this issue Jan 16, 2025 · 0 comments
Open

Backend: creating a user management admin #136

arath7 opened this issue Jan 16, 2025 · 0 comments

Comments

@arath7
Copy link
Contributor

arath7 commented Jan 16, 2025

Right now, we have a super admin that can do task template and study builder editing as well as user management. We want 3 admins total: a super admin that does both, an admin for just study builder component editing, and an admin for just user management. This ticket will be the backend for creating the user management admin.

  • Add a role field to the userSchema to distinguish between different admin types (for this ticket, just distinguish between super admin and user management admin) in models/user.ts
  • Modify the isAdmin middleware to enforce permissions based on roles in middleware/auth.ts (like a hasRole)
  • Update the admin.route.ts for role based permissions. Modify/update existing routes to restrict access based on roles. Super admins can do everything but user admin can only use routes related to access control (adding/removing users)
@arath7 arath7 changed the title Creating a Super Admin - Backend Backend: creating a user management admin Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant