Jump to content

Programming Challenge: Enterprise Role-Based Access Control (RBAC) System (Jan 17, 2025)

Featured Replies

Posted

Challenge:

Create a Role-Based Access Control (RBAC) system where users have different roles with assigned permissions that control what actions they can perform.

This challenge is highly relevant in enterprise IT, DevOps, and cybersecurity, where securing access to resources is critical for compliance and security.

Basic Requirements:

  1. Define roles and permissions, such as:

    • Admin: Full access

    • Developer: Can read/write code but cannot change user roles

    • Viewer: Read-only access

  2. Allow users to log in and see only the actions they’re authorized for.

  3. Implement a permission check function that validates if a user can perform an action.

Role Definitions & Permissions

Role

Can View Reports

Can Edit Code

Can Deploy Code

Can Manage Users

Admin

Yes

Yes

Yes

Yes

Developer

Yes

Yes

No

No

Viewer

Yes

No

No

No

Bonus Features:

Allow an Admin to create new roles dynamically.
Store user roles and permissions in a database or JSON file for persistence.
Implement a command-line interface (CLI) or web API to interact with the system.
Add audit logging to track user activity (e.g., "User X accessed confidential reports").
Extend it to multi-factor authentication (MFA) for enterprise security compliance.

Example Output:

Welcome to Enterprise RBAC System
Enter username: alice
Role: Developer

Available Actions:
1. View Reports
2. Edit Code
3. Request Deployment

Enter action: 3
Access Denied! You do not have permission to deploy code.

This challenge helps with authentication, authorization, security best practices, and enterprise-level access control. It’s a real-world scenario used in DevOps, IT security, and software engineering.

  • Views 99
  • Created
  • Last Reply

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.