summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/user_management_commands_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/user_management_commands_common.cpp')
-rw-r--r--src/mongo/db/commands/user_management_commands_common.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/db/commands/user_management_commands_common.cpp b/src/mongo/db/commands/user_management_commands_common.cpp
index 03a6a129fdc..292c21a8255 100644
--- a/src/mongo/db/commands/user_management_commands_common.cpp
+++ b/src/mongo/db/commands/user_management_commands_common.cpp
@@ -66,8 +66,8 @@ Status checkAuthorizedToGrantRoles(AuthorizationSession* authzSession,
for (size_t i = 0; i < roles.size(); ++i) {
if (!authzSession->isAuthorizedToGrantRole(roles[i])) {
return Status(ErrorCodes::Unauthorized,
- str::stream()
- << "Not authorized to grant role: " << roles[i].getFullName());
+ str::stream() << "Not authorized to grant role: "
+ << roles[i].getFullName());
}
}
@@ -91,8 +91,8 @@ Status checkAuthorizedToRevokeRoles(AuthorizationSession* authzSession,
for (size_t i = 0; i < roles.size(); ++i) {
if (!authzSession->isAuthorizedToRevokeRole(roles[i])) {
return Status(ErrorCodes::Unauthorized,
- str::stream()
- << "Not authorized to revoke role: " << roles[i].getFullName());
+ str::stream() << "Not authorized to revoke role: "
+ << roles[i].getFullName());
}
}
return Status::OK();
@@ -123,8 +123,8 @@ Status checkAuthForCreateUserCommand(ClientBasic* client,
if (!authzSession->isAuthorizedForActionsOnResource(
ResourcePattern::forDatabaseName(args.userName.getDB()), ActionType::createUser)) {
return Status(ErrorCodes::Unauthorized,
- str::stream()
- << "Not authorized to create users on db: " << args.userName.getDB());
+ str::stream() << "Not authorized to create users on db: "
+ << args.userName.getDB());
}
return checkAuthorizedToGrantRoles(authzSession, args.roles);
@@ -205,8 +205,8 @@ Status checkAuthForCreateRoleCommand(ClientBasic* client,
if (!authzSession->isAuthorizedToCreateRole(args)) {
return Status(ErrorCodes::Unauthorized,
- str::stream()
- << "Not authorized to create roles on db: " << args.roleName.getDB());
+ str::stream() << "Not authorized to create roles on db: "
+ << args.roleName.getDB());
}
status = checkAuthorizedToGrantRoles(authzSession, args.roles);
@@ -441,7 +441,8 @@ Status checkAuthForRolesInfoCommand(ClientBasic* client,
ActionType::viewRole)) {
return Status(ErrorCodes::Unauthorized,
str::stream() << "Not authorized to view roles from the "
- << args.roleNames[i].getDB() << " database");
+ << args.roleNames[i].getDB()
+ << " database");
}
}
}