This is a sample Role Based Access Control Model with follwing details -
Roles currently - 1) Admin ( Code - 0) 2) Developer ( Code - 1) 3) Tester ( Code - 2)
Operations that can be done by -
ADMIN -
- Create a new user
- Delete an existing user
- Check Roles assigned to loggedIn user ( can be exteded later to get the roles of other users as well )
- Assign Roles
- Remove role
- Read a file
- Write in a file
- Verify a file
DEVELOPER -
- Read a file
- Write a file
TESTER -
- Read a file
- Verify a file
Files Description - The project contains mainly 6 files -
- RBAC.cpp -> The init file ( start )
- User class -> contain the User info.
- Info class -> contains the three user info ( USERNAME, USER_ID, ROLES )
- Role class -> contains the details of the Roles assigned to a particular user and the operation ptr to access the desired operations for a particular role. ( ROLE_NAME, ROLE_ID, Operation ptr)
- Operations class -> This enlists the list of operations currently present in the RBAC system ( can be extended later to inculcate new operations )
- DataBase class -> To hold the users details