Build an API with role-based access control (RBAC) for different user permissions.
This challenge is tech-agnostic. Choose your preferred programming language, framework, database, ORM, and caching solution. For middle level, you can use advanced features like caching.
- Define user roles and permissions
- Implement authorization middleware
- Restrict access based on roles
-
Environment Setup:
- Programming language and web framework
- Database and ORM
- Caching solution
- Docker (recommended for containerization)
-
Implementation Details:
- Create user roles (admin, user, etc.)
- Implement middleware to check permissions
- Protect endpoints with role requirements
-
Testing:
- Test access with different user roles
- Add resource-level permissions
- Implement permission inheritance
By completing this challenge, you will understand role-based authorization.
Happy coding!