Skip to content

Commit

Permalink
Rename getGrantOptionForPrivilege to hasGrantOptionForPrivilege
Browse files Browse the repository at this point in the history
Extracted-From: prestodb/presto#10904
  • Loading branch information
Andrii Rosa authored and sopel39 committed Jan 29, 2019
1 parent 31e9d26 commit 942cde9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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());
}
}
Expand All @@ -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());
}
}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 942cde9

Please sign in to comment.