rcpp_framework/web_modules/rbac_users/rbac_user.cpp

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() {
}