xunliu commented on code in PR #4515:
URL: https://github.com/apache/gravitino/pull/4515#discussion_r1720960360


##########
api/src/main/java/org/apache/gravitino/authorization/RoleChange.java:
##########
@@ -152,4 +165,88 @@ public String toString() {
       return "REMOVESECURABLEOBJECT " + securableObject;
     }
   }
+
+  /**
+   * A UpdateSecurableObject to update securable object's privilege from role. 
<br>
+   * The securable object's metadata entity must same as new securable 
object's metadata entity.

Review Comment:
   DONE.



##########
api/src/main/java/org/apache/gravitino/authorization/RoleChange.java:
##########
@@ -152,4 +165,88 @@ public String toString() {
       return "REMOVESECURABLEOBJECT " + securableObject;
     }
   }
+
+  /**
+   * A UpdateSecurableObject to update securable object's privilege from role. 
<br>
+   * The securable object's metadata entity must same as new securable 
object's metadata entity.
+   * <br>
+   * The securable object's privilege must be different as new securable 
object's privilege. <br>
+   */
+  final class UpdateSecurableObject implements RoleChange {
+    private final SecurableObject securableObject;
+    private final SecurableObject newSecurableObject;
+
+    private UpdateSecurableObject(
+        SecurableObject securableObject, SecurableObject newSecurableObject) {
+      if (!securableObject.fullName().equals(newSecurableObject.fullName())) {
+        throw new IllegalArgumentException(
+            "The securable object's metadata entity must be same as new 
securable object's metadata entity.");
+      }
+      if 
(securableObject.privileges().containsAll(newSecurableObject.privileges())) {
+        throw new IllegalArgumentException(
+            "The securable object's privilege must be different as new 
securable object's privilege.");

Review Comment:
   DONE



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