Exemplo n.º 1
0
 void ActionSet::addAction(const ActionType& action) {
     if (action == ActionType::anyAction) {
         addAllActions();
         return;
     }
     _actions.set(action.getIdentifier(), true);
 }
Exemplo n.º 2
0
 // Takes an ActionType and returns the string representation
 std::string ActionType::actionToString(const ActionType& action) {
     switch (action.getIdentifier()) {
     case READ_VALUE:
         return "r";
     case READ_WRITE_VALUE:
         return "w";
     case USER_ADMIN_VALUE:
         return "u";
     case DB_ADMIN_VALUE:
         return "d";
     case SERVER_ADMIN_VALUE:
         return "s";
     case CLUSTER_ADMIN_VALUE:
         return "c";
     default:
         return "";
     }
 }
Exemplo n.º 3
0
 bool ActionSet::contains(const ActionType& action) const {
     return _actions[action.getIdentifier()];
 }
Exemplo n.º 4
0
 void ActionSet::removeAction(const ActionType& action) {
     _actions.set(action.getIdentifier(), false);
     _actions.set(ActionType::anyAction.getIdentifier(), false);
 }
Exemplo n.º 5
0
 void ActionSet::addAction(const ActionType& action) {
     _actions.set(action.getIdentifier(), true);
 }