void ActionSet::addAction(const ActionType& action) { if (action == ActionType::anyAction) { addAllActions(); return; } _actions.set(action.getIdentifier(), true); }
// 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 ""; } }
bool ActionSet::contains(const ActionType& action) const { return _actions[action.getIdentifier()]; }
void ActionSet::removeAction(const ActionType& action) { _actions.set(action.getIdentifier(), false); _actions.set(ActionType::anyAction.getIdentifier(), false); }
void ActionSet::addAction(const ActionType& action) { _actions.set(action.getIdentifier(), true); }