rcpp_framework/modules/rbac/rbac_rank.cpp

24 lines
402 B
C++
Raw Normal View History

#include "rbac_rank.h"
2021-11-02 12:26:26 +01:00
void RBACRank::sort_permissions() {
for (int i = 0; i < permissions.size(); ++i) {
for (int j = i + 1; j < permissions.size(); ++j) {
if (permissions[j]->is_smaller(permissions[i])) {
permissions.swap(i, j);
}
}
}
}
RBACRank::RBACRank() :
Resource() {
id = 0;
base_permissions = 0;
2021-11-01 15:12:09 +01:00
rank_permissions = 0;
}
RBACRank::~RBACRank() {
2021-11-01 15:12:09 +01:00
permissions.clear();
}