You are developing a web application with various user roles, each with different access levels to the application’s resources. How would you design the authorization system to ensure proper access control, scalability, and maintainability?
- Use a single "admin" role for all users
- Implement access control checks within route handlers
- Use a role-based access control (RBAC) system
- Give every user full access to all resources
To ensure proper access control, scalability, and maintainability in a web application with multiple user roles, you should use a role-based access control (RBAC) system. RBAC allows for fine-grained control over user permissions and is scalable as your application grows. The other options are not recommended, as they lack proper access control or are not scalable.
Loading...
Related Quiz
- How does the Event Loop handle asynchronous tasks in Node.js?
- The 'highWaterMark' option in Node.js streams denotes the ______ of the internal buffer.
- In Node.js, the process.cwd() method returns the ________.
- How can you install ESLint in your Node.js project?
- In a NoSQL database like MongoDB, how are schemas defined and enforced?