Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/util/account_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,10 @@ function validate_and_return_requested_account(params, action, requesting_accoun
// When accesskeyt API called without specific username, action on the same requesting account.
// So in that case requesting account and requested account is same.
requested_account = requesting_account;
// we do not allow for AWS account root user to perform IAM action on itself
if (requesting_account.owner === undefined) {
throw new RpcError('NOT_AUTHORIZED', 'You do not have permission to perform this action.');
}
} else {
_check_if_requesting_account_is_root_account(action, requesting_account, { username: params.username });
const account_email = get_account_name_from_username(params.username, requesting_account._id.toString());
Expand Down