-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminModule.h
44 lines (37 loc) · 992 Bytes
/
AdminModule.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ADMIN_MODULE_H
#define ADMIN_MODULE_H
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
// Enumerations for user roles
enum class UserRole {
STUDENT,
FACULTY,
HOD,
REGISTRAR,
ACCOUNTS_OFFICER,
DEAN,
ADMIN
};
// Structure for User
struct User {
int userID;
std::string username;
std::string password;
UserRole role;
User(int id, const std::string& uname, const std::string& pwd, UserRole r)
: userID(id), username(uname), password(pwd), role(r) {}
};
class AdminModule {
private:
std::vector<User> users;
int userCounter = 1;
public:
void addUser(const std::string& username, const std::string& password, UserRole role);
void deleteUser(int userID);
User* authenticateUser(const std::string& username, const std::string& password);
void displayUsers() const;
std::vector<User> getUsers() const;
};
#endif // ADMIN_MODULE_H