diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-05-07 19:51:11 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-05-22 14:08:54 -0400 |
commit | 0467aeb4416f82ff18927f3f887cd181073e1db6 (patch) | |
tree | ce2f3704fec533241898d9d8571f428ae7b461fc /src/mongo/db/auth/privilege.cpp | |
parent | 59c64b943afa52b4d837949b1094be1d895bf062 (diff) | |
download | mongo-0467aeb4416f82ff18927f3f887cd181073e1db6.tar.gz |
SERVER-9518 Initial implementation of RoleGraph data structures
Diffstat (limited to 'src/mongo/db/auth/privilege.cpp')
-rw-r--r-- | src/mongo/db/auth/privilege.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/auth/privilege.cpp b/src/mongo/db/auth/privilege.cpp index 88401c91ad5..d1797473aad 100644 --- a/src/mongo/db/auth/privilege.cpp +++ b/src/mongo/db/auth/privilege.cpp @@ -31,6 +31,14 @@ namespace mongo { Privilege::Privilege(const std::string& resource, const ActionSet& actions) : _resource(resource), _actions(actions) {} + void Privilege::addActions(const ActionSet& actionsToAdd) { + _actions.addAllActionsFromSet(actionsToAdd); + } + + void Privilege::removeActions(const ActionSet& actionsToRemove) { + _actions.removeAllActionsFromSet(actionsToRemove); + } + bool Privilege::includesAction(const ActionType& action) const { return _actions.contains(action); } |