From 942cde9cc3f9984922f91987fd3e535a6b3e2f4f Mon Sep 17 00:00:00 2001 From: Andrii Rosa Date: Tue, 28 Nov 2017 14:51:17 +0100 Subject: [PATCH] Rename getGrantOptionForPrivilege to hasGrantOptionForPrivilege Extracted-From: https://github.com/prestodb/presto/pull/10904 --- .../plugin/hive/security/SqlStandardAccessControl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(