public class RangerBasedAccessControl extends Object implements ConnectorAccessControl
| Constructor and Description |
|---|
RangerBasedAccessControl(RangerBasedAccessControlConfig config,
com.facebook.airlift.http.client.HttpClient httpClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkCanAddColumn(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to add columns to the specified table in this catalog.
|
void |
checkCanCreateSchema(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String schemaName)
Check if identity is allowed to create the specified schema in this catalog.
|
void |
checkCanCreateTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to create the specified table in this catalog.
|
void |
checkCanCreateView(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName viewName)
Check if identity is allowed to create the specified view in this catalog.
|
void |
checkCanCreateViewWithSelectFromColumns(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName,
Set<String> columnNames)
Check if identity is allowed to create a view that selects from the specified columns in a relation.
|
void |
checkCanDeleteFromTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to delete from the specified table in this catalog.
|
void |
checkCanDropColumn(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to drop columns from the specified table in this catalog.
|
void |
checkCanDropSchema(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String schemaName)
Check if identity is allowed to drop the specified schema in this catalog.
|
void |
checkCanDropTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to drop the specified table in this catalog.
|
void |
checkCanDropView(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName viewName)
Check if identity is allowed to drop the specified view in this catalog.
|
void |
checkCanInsertIntoTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to insert into the specified table in this catalog.
|
void |
checkCanRenameColumn(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to rename a column in the specified table in this catalog.
|
void |
checkCanRenameTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName,
SchemaTableName newTableName)
Check if identity is allowed to rename the specified table in this catalog.
|
void |
checkCanSelectFromColumns(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName,
Set<Subfield> columnOrSubfieldNames)
Check if identity is allowed to select from the specified columns in a relation.
|
void |
checkCanSetCatalogSessionProperty(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String propertyName)
Check if identity is allowed to set the specified property in this catalog.
|
void |
checkCanShowSchemas(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context)
Check if identity is allowed to execute SHOW SCHEMAS in a catalog.
|
void |
checkCanShowTablesMetadata(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String schemaName)
Check if identity is allowed to show metadata of tables by executing SHOW TABLES, SHOW GRANTS etc.
|
Set<String> |
filterSchemas(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Set<String> schemaNames)
Filter the list of schemas to those visible to the identity.
|
Set<SchemaTableName> |
filterTables(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Set<SchemaTableName> tableNames)
Filter the list of tables and views to those visible to the identity.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckCanCreateRole, checkCanDropRole, checkCanGrantRoles, checkCanGrantTablePrivilege, checkCanRenameSchema, checkCanRevokeRoles, checkCanRevokeTablePrivilege, checkCanSetRole, checkCanShowCurrentRoles, checkCanShowRoleGrants, checkCanShowRoles, checkCanTruncateTable@Inject public RangerBasedAccessControl(RangerBasedAccessControlConfig config, com.facebook.airlift.http.client.HttpClient httpClient)
public void checkCanCreateSchema(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String schemaName)
checkCanCreateSchema in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanDropSchema(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String schemaName)
checkCanDropSchema in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanShowSchemas(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context)
NOTE: This method is only present to give users an error message when listing is not allowed.
The filterSchemas(com.facebook.presto.spi.connector.ConnectorTransactionHandle, com.facebook.presto.spi.security.ConnectorIdentity, com.facebook.presto.spi.security.AccessControlContext, java.util.Set<java.lang.String>) method must handle filter all results for unauthorized users,
since there are multiple way to list schemas.
checkCanShowSchemas in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic Set<String> filterSchemas(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Set<String> schemaNames)
filterSchemas in interface ConnectorAccessControlpublic void checkCanCreateTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanCreateTable in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic Set<SchemaTableName> filterTables(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Set<SchemaTableName> tableNames)
filterTables in interface ConnectorAccessControlpublic void checkCanAddColumn(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanAddColumn in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanDropColumn(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanDropColumn in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanRenameColumn(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanRenameColumn in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanSelectFromColumns(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName, Set<Subfield> columnOrSubfieldNames)
checkCanSelectFromColumns in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanDropTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanDropTable in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanRenameTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName, SchemaTableName newTableName)
checkCanRenameTable in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanShowTablesMetadata(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String schemaName)
NOTE: This method is only present to give users an error message when listing is not allowed.
The filterTables(com.facebook.presto.spi.connector.ConnectorTransactionHandle, com.facebook.presto.spi.security.ConnectorIdentity, com.facebook.presto.spi.security.AccessControlContext, java.util.Set<com.facebook.presto.spi.SchemaTableName>) method must filter all results for unauthorized users,
since there are multiple ways to list tables.
checkCanShowTablesMetadata in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanInsertIntoTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanInsertIntoTable in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanDeleteFromTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
checkCanDeleteFromTable in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanCreateView(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName viewName)
checkCanCreateView in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanDropView(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName viewName)
checkCanDropView in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanCreateViewWithSelectFromColumns(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName, Set<String> columnNames)
checkCanCreateViewWithSelectFromColumns in interface ConnectorAccessControlAccessDeniedException - if not allowedpublic void checkCanSetCatalogSessionProperty(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String propertyName)
checkCanSetCatalogSessionProperty in interface ConnectorAccessControlAccessDeniedException - if not allowedCopyright © 2012–2023. All rights reserved.