You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/05/02 07:57:51 UTC

[GitHub] [hive] pvary commented on a diff in pull request #3218: HIVE-26148: Keep MetaStoreFilterHook interface compatibility after introducing catalogs.

pvary commented on code in PR #3218:
URL: https://github.com/apache/hive/pull/3218#discussion_r862656055


##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeSynchronizer.java:
##########
@@ -89,18 +89,21 @@ private void addACLsToBag(
       for (Map.Entry<HiveResourceACLs.Privilege, HiveResourceACLs.AccessResult> acl : principalAcls.getValue()
           .entrySet()) {
         if (acl.getValue() == HiveResourceACLs.AccessResult.ALLOWED) {
+          HiveObjectRef hiveObjectRef = null;
           switch (objectType) {
           case DATABASE:
+            hiveObjectRef = new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null);

Review Comment:
   Shall we set the catalogname to the `HiveObjectRef`?



##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/PrivilegeSynchronizer.java:
##########
@@ -89,18 +89,21 @@ private void addACLsToBag(
       for (Map.Entry<HiveResourceACLs.Privilege, HiveResourceACLs.AccessResult> acl : principalAcls.getValue()
           .entrySet()) {
         if (acl.getValue() == HiveResourceACLs.AccessResult.ALLOWED) {
+          HiveObjectRef hiveObjectRef = null;
           switch (objectType) {
           case DATABASE:
+            hiveObjectRef = new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null);
+            hiveObjectRef.setCatName(catName);
             privBag.addToPrivileges(
-                new HiveObjectPrivilege(new HiveObjectRef(HiveObjectType.DATABASE, dbName, null, null, null), principal,
-                    principalType, new PrivilegeGrantInfo(acl.getKey().toString(),
-                        (int) (System.currentTimeMillis() / 1000), GRANTOR, PrincipalType.USER, false), authorizer));
+                new HiveObjectPrivilege(hiveObjectRef, principal, principalType, new PrivilegeGrantInfo(acl.getKey().toString(),

Review Comment:
   Same as above



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org