jerqi commented on code in PR #8253:
URL: https://github.com/apache/gravitino/pull/8253#discussion_r2297282794


##########
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:
   Fixed.



-- 
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]

Reply via email to