Posted January 17Jan 17 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:Define roles and permissions, such as:Admin: Full accessDeveloper: Can read/write code but cannot change user rolesViewer: Read-only accessAllow users to log in and see only the actions they’re authorized for.Implement a permission check function that validates if a user can perform an action.Role Definitions & PermissionsRoleCan View ReportsCan Edit CodeCan Deploy CodeCan Manage UsersAdmin✅ Yes✅ Yes✅ Yes✅ YesDeveloper✅ Yes✅ Yes❌ No❌ NoViewer✅ Yes❌ No❌ No❌ NoBonus 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.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.