The program implements university access system, in fact, it is easily adjustable for your own needs.
By default program supports:
- 5 classes representing types of users
- 5 classes representing types of rooms
- 4 types of access levels
Any of the abovementioned is easily expandable.
You will need to build the program from source code.
In order to run the program you need to provide two databases:
- User database (you can replace the default one named
database.txtconsisting of 60 users) - Room database (you can replace the default one named
room-database.txtconsisting of 47 rooms)
Make sure to follow the name convention and the structure:
-
For
database.txt:{ { name, occupation, subject, age, subjectYears }, { name, occupation, subject, age, subjectYears }, //... } -
For
room-database.txt:{ name, name, //... }
You should double check the correctness of your databases, then initialize them:
Users::initialize();
Rooms::initialize();Now the Access System is ready to use.
Primary methods that you will use have the following signatures:
class User {
public:
void goToRoom(Room* room);
virtual void allowUser(User* user, Room* room);
virtual void forbidUser(User* user, Room* room);
}User tries to open a room. Uses Access System's method that checks permission of this user to open the room based on accessLevel of the room, accessibleLevel of the user, list of banned users from this room and users with custom access to this room (whitelist).
Adds user to whitelist and removes from banlist of a specific room.
Adds user to banlist and removes from whitelist of a specific room.
This is not stable release of a program. You are running this program at your own risk.
Copyright © 2021. All rights reserved.