summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/user.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2013-10-08 16:26:48 -0400
committerSpencer T Brody <spencer@10gen.com>2013-10-10 11:52:06 -0400
commit586c2dea5a72bfc2917af91d0751fcd399c0209b (patch)
tree2bff22a9922a3434df5271317a9ef93c7e5e81e6 /src/mongo/db/auth/user.cpp
parentbbf4667c8c437d6db93b9c3ec711e40d49349b45 (diff)
downloadmongo-586c2dea5a72bfc2917af91d0751fcd399c0209b.tar.gz
SERVER-6246 SERVER-9515 Implement proper authz checks for user and role management commands
Diffstat (limited to 'src/mongo/db/auth/user.cpp')
-rw-r--r--src/mongo/db/auth/user.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/auth/user.cpp b/src/mongo/db/auth/user.cpp
index 03ef82bbe1b..6895cd27398 100644
--- a/src/mongo/db/auth/user.cpp
+++ b/src/mongo/db/auth/user.cpp
@@ -40,6 +40,10 @@ namespace mongo {
return _roles;
}
+ bool User::hasRole(const RoleName& roleName) const {
+ return _roles.count(roleName);
+ }
+
const User::CredentialData& User::getCredentials() const {
return _credentials;
}