Skip to content

Commit

Permalink
SERVER-11474 connect auditLogging of revokeRolesFromUser and grantRol…
Browse files Browse the repository at this point in the history
…esToUser
  • Loading branch information
matt dannenberg committed Oct 30, 2013
1 parent 67defc7 commit d8ed1f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mongo/db/commands/user_management_commands.cpp
Expand Up @@ -867,6 +867,9 @@ namespace mongo {
userRoles.insert(roleName);
}

audit::logGrantRolesToUser(ClientBasic::getCurrent(),
userName,
roles);
BSONArray newRolesBSONArray = roleSetToBSONArray(userRoles);
status = authzManager->updatePrivilegeDocument(
userName, BSON("$set" << BSON("roles" << newRolesBSONArray)), writeConcern);
Expand Down Expand Up @@ -979,6 +982,9 @@ namespace mongo {
userRoles.erase(roleName);
}

audit::logRevokeRolesFromUser(ClientBasic::getCurrent(),
userName,
roles);
BSONArray newRolesBSONArray = roleSetToBSONArray(userRoles);
status = authzManager->updatePrivilegeDocument(
userName, BSON("$set" << BSON("roles" << newRolesBSONArray)), writeConcern);
Expand Down

0 comments on commit d8ed1f0

Please sign in to comment.