2021-11-10 15:32:44 +01:00
|
|
|
#include "rbac_user.h"
|
|
|
|
|
2022-01-06 11:34:53 +01:00
|
|
|
int RBACUser::get_permissions(Request *request) {
|
|
|
|
if (!rbac_rank.is_valid()) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rbac_rank->get_permissions(request);
|
|
|
|
}
|
2021-11-10 19:35:02 +01:00
|
|
|
bool RBACUser::has_permission(Request *request, const int permission) {
|
|
|
|
if (!rbac_rank.is_valid()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rbac_rank->has_permission(request, permission);
|
|
|
|
}
|
2022-01-06 11:34:53 +01:00
|
|
|
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;
|
|
|
|
}
|
2021-11-10 19:35:02 +01:00
|
|
|
|
2021-11-10 15:32:44 +01:00
|
|
|
RBACUser::RBACUser() :
|
|
|
|
User() {
|
|
|
|
}
|
|
|
|
|
|
|
|
RBACUser::~RBACUser() {
|
|
|
|
}
|