mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 12:26:59 +01:00
38 lines
742 B
C++
38 lines
742 B
C++
#include "rbac_user.h"
|
|
|
|
int RBACUser::get_permissions(Request *request) {
|
|
if (!rbac_rank.is_valid()) {
|
|
return 0;
|
|
}
|
|
|
|
return rbac_rank->get_permissions(request);
|
|
}
|
|
bool RBACUser::has_permission(Request *request, const int permission) {
|
|
if (!rbac_rank.is_valid()) {
|
|
return false;
|
|
}
|
|
|
|
return rbac_rank->has_permission(request, permission);
|
|
}
|
|
int RBACUser::get_additional_permissions(Request *request) {
|
|
if (!rbac_rank.is_valid()) {
|
|
return 0;
|
|
}
|
|
|
|
return rbac_rank->rank_permissions;
|
|
}
|
|
bool RBACUser::has_additional_permission(Request *request, const int permission) {
|
|
if (!rbac_rank.is_valid()) {
|
|
return false;
|
|
}
|
|
|
|
return rbac_rank->rank_permissions & permission;
|
|
}
|
|
|
|
RBACUser::RBACUser() :
|
|
User() {
|
|
}
|
|
|
|
RBACUser::~RBACUser() {
|
|
}
|