mchades commented on code in PR #8253:
URL: https://github.com/apache/gravitino/pull/8253#discussion_r2297260731
##########
server/src/main/java/org/apache/gravitino/server/web/rest/GroupOperations.java:
##########
@@ -124,6 +130,20 @@ public Response removeGroup(
return Utils.doAs(
httpRequest,
() -> {
+ Owner owner =
+ ownerDispatcher
+ .getOwner(
+ metalake, MetadataObjects.of(null, metalake,
MetadataObject.Type.METALAKE))
+ .orElseThrow(
+ () ->
+ new IllegalStateException("Owner not found for
metalake: " + metalake));
Review Comment:
Does this mean that if the metalake owner cannot be found, we are unable to
delete the group as well?
##########
server/src/main/java/org/apache/gravitino/server/web/rest/GroupOperations.java:
##########
@@ -124,6 +130,20 @@ public Response removeGroup(
return Utils.doAs(
httpRequest,
() -> {
+ Owner owner =
+ ownerDispatcher
+ .getOwner(
+ metalake, MetadataObjects.of(null, metalake,
MetadataObject.Type.METALAKE))
+ .orElseThrow(
+ () ->
+ new IllegalStateException("Owner not found for
metalake: " + metalake));
+ if (owner.type() == Owner.Type.GROUP &&
owner.name().equals(group)) {
+ throw new IllegalArgumentException(
+ String.format(
+ "Cannot remove group %s from metalake %s because the
current user is not the owner of the metalake.",
Review Comment:
the message does not match the condition
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]