Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If there is only one admin role member, the member cannot be deleted. #2810

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

TakuyaMatsu
Copy link
Contributor

@TakuyaMatsu TakuyaMatsu commented Nov 27, 2024

Description

If the admin role has only one member, deleting the member using the deleteDomainRoleMember API will leave the admin role with no members.

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@TakuyaMatsu TakuyaMatsu force-pushed the fix-deleteDomainRoleMember branch from eb2fb15 to a8a9a64 Compare November 27, 2024 06:34
}
List<RoleMember> members = adminRole.getRoleMembers();
if (members.size() == 1 && members.get(0).getMemberName().equals(memberName)) {
throw ZMSUtils.forbiddenError("deleteDomainRoleMember: Cannot delete last member of 'admin' role", caller);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a minor comment but please use 4 spaces for the indent to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@TakuyaMatsu TakuyaMatsu force-pushed the fix-deleteDomainRoleMember branch from a8a9a64 to a3896ce Compare November 28, 2024 00:32
Copy link
Collaborator

@havetisyan havetisyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@havetisyan havetisyan merged commit fdb2f06 into AthenZ:master Nov 28, 2024
1 check passed
@TakuyaMatsu TakuyaMatsu deleted the fix-deleteDomainRoleMember branch November 28, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants