diff --git a/presto-hive/src/main/java/io/prestosql/plugin/hive/security/SqlStandardAccessControl.java b/presto-hive/src/main/java/io/prestosql/plugin/hive/security/SqlStandardAccessControl.java index ec028cc80a5f..145158ff1994 100644 --- a/presto-hive/src/main/java/io/prestosql/plugin/hive/security/SqlStandardAccessControl.java +++ b/presto-hive/src/main/java/io/prestosql/plugin/hive/security/SqlStandardAccessControl.java @@ -233,7 +233,7 @@ public void checkCanCreateViewWithSelectFromColumns(ConnectorTransactionHandle t if (!checkTablePermission(transaction, identity, tableName, SELECT)) { denySelectTable(tableName.toString()); } - if (!getGrantOptionForPrivilege(transaction, identity, Privilege.SELECT, tableName)) { + if (!hasGrantOptionForPrivilege(transaction, identity, Privilege.SELECT, tableName)) { denyCreateViewWithSelect(tableName.toString(), identity); } } @@ -254,7 +254,7 @@ public void checkCanGrantTablePrivilege(ConnectorTransactionHandle transaction, } HivePrivilege hivePrivilege = toHivePrivilege(privilege); - if (hivePrivilege == null || !getGrantOptionForPrivilege(transaction, identity, privilege, tableName)) { + if (hivePrivilege == null || !hasGrantOptionForPrivilege(transaction, identity, privilege, tableName)) { denyGrantTablePrivilege(privilege.name(), tableName.toString()); } } @@ -267,7 +267,7 @@ public void checkCanRevokeTablePrivilege(ConnectorTransactionHandle transaction, } HivePrivilege hivePrivilege = toHivePrivilege(privilege); - if (hivePrivilege == null || !getGrantOptionForPrivilege(transaction, identity, privilege, tableName)) { + if (hivePrivilege == null || !hasGrantOptionForPrivilege(transaction, identity, privilege, tableName)) { denyRevokeTablePrivilege(privilege.name(), tableName.toString()); } } @@ -396,7 +396,7 @@ private boolean checkTablePermission(ConnectorTransactionHandle transaction, Con return privilegeSet.containsAll(ImmutableSet.copyOf(requiredPrivileges)); } - private boolean getGrantOptionForPrivilege(ConnectorTransactionHandle transaction, ConnectorIdentity identity, Privilege privilege, SchemaTableName tableName) + private boolean hasGrantOptionForPrivilege(ConnectorTransactionHandle transaction, ConnectorIdentity identity, Privilege privilege, SchemaTableName tableName) { SemiTransactionalHiveMetastore metastore = metastoreProvider.apply(((HiveTransactionHandle) transaction)); return listApplicableTablePrivileges(