public interface ConnectorAccessControl
Modifier and Type | Method and Description |
---|---|
default void |
checkCanAddColumn(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to add columns to the specified table in this catalog.
|
default void |
checkCanCreateSchema(ConnectorTransactionHandle transactionHandle,
Identity identity,
String schemaName)
Check if identity is allowed to create the specified schema in this catalog.
|
default void |
checkCanCreateTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to create the specified table in this catalog.
|
default void |
checkCanCreateView(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName viewName)
Check if identity is allowed to create the specified view in this catalog.
|
default void |
checkCanCreateViewWithSelectFromColumns(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName,
Set<String> columnNames)
Check if identity is allowed to create a view that selects from the specified columns in a relation.
|
default void |
checkCanCreateViewWithSelectFromTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
|
default void |
checkCanCreateViewWithSelectFromView(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName viewName)
|
default void |
checkCanDeleteFromTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to delete from the specified table in this catalog.
|
default void |
checkCanDropColumn(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to drop columns from the specified table in this catalog.
|
default void |
checkCanDropSchema(ConnectorTransactionHandle transactionHandle,
Identity identity,
String schemaName)
Check if identity is allowed to drop the specified schema in this catalog.
|
default void |
checkCanDropTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to drop the specified table in this catalog.
|
default void |
checkCanDropView(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName viewName)
Check if identity is allowed to drop the specified view in this catalog.
|
default void |
checkCanGrantTablePrivilege(ConnectorTransactionHandle transactionHandle,
Identity identity,
Privilege privilege,
SchemaTableName tableName,
String grantee,
boolean withGrantOption)
Check if identity is allowed to grant to any other user the specified privilege on the specified table.
|
default void |
checkCanInsertIntoTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to insert into the specified table in this catalog.
|
default void |
checkCanRenameColumn(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
Check if identity is allowed to rename a column in the specified table in this catalog.
|
default void |
checkCanRenameSchema(ConnectorTransactionHandle transactionHandle,
Identity identity,
String schemaName,
String newSchemaName)
Check if identity is allowed to rename the specified schema in this catalog.
|
default void |
checkCanRenameTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName,
SchemaTableName newTableName)
Check if identity is allowed to rename the specified table in this catalog.
|
default void |
checkCanRevokeTablePrivilege(ConnectorTransactionHandle transactionHandle,
Identity identity,
Privilege privilege,
SchemaTableName tableName,
String revokee,
boolean grantOptionFor)
Check if identity is allowed to revoke the specified privilege on the specified table from any user.
|
default void |
checkCanSelectFromColumns(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName,
Set<String> columnNames)
Check if identity is allowed to select from the specified columns in a relation.
|
default void |
checkCanSelectFromTable(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName tableName)
|
default void |
checkCanSelectFromView(ConnectorTransactionHandle transactionHandle,
Identity identity,
SchemaTableName viewName)
|
default void |
checkCanSetCatalogSessionProperty(Identity identity,
String propertyName)
Check if identity is allowed to set the specified property in this catalog.
|
default void |
checkCanShowSchemas(ConnectorTransactionHandle transactionHandle,
Identity identity)
Check if identity is allowed to execute SHOW SCHEMAS in a catalog.
|
default void |
checkCanShowTablesMetadata(ConnectorTransactionHandle transactionHandle,
Identity identity,
String schemaName)
Check if identity is allowed to show metadata of tables by executing SHOW TABLES, SHOW GRANTS etc.
|
default Set<String> |
filterSchemas(ConnectorTransactionHandle transactionHandle,
Identity identity,
Set<String> schemaNames)
Filter the list of schemas to those visible to the identity.
|
default Set<SchemaTableName> |
filterTables(ConnectorTransactionHandle transactionHandle,
Identity identity,
Set<SchemaTableName> tableNames)
Filter the list of tables and views to those visible to the identity.
|
default void checkCanCreateSchema(ConnectorTransactionHandle transactionHandle, Identity identity, String schemaName)
AccessDeniedException
- if not alloweddefault void checkCanDropSchema(ConnectorTransactionHandle transactionHandle, Identity identity, String schemaName)
AccessDeniedException
- if not alloweddefault void checkCanRenameSchema(ConnectorTransactionHandle transactionHandle, Identity identity, String schemaName, String newSchemaName)
AccessDeniedException
- if not alloweddefault void checkCanShowSchemas(ConnectorTransactionHandle transactionHandle, Identity identity)
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.Identity, java.util.Set<java.lang.String>)
method must handle filter all results for unauthorized users,
since there are multiple way to list schemas.
AccessDeniedException
- if not alloweddefault Set<String> filterSchemas(ConnectorTransactionHandle transactionHandle, Identity identity, Set<String> schemaNames)
default void checkCanCreateTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanDropTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanRenameTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName, SchemaTableName newTableName)
AccessDeniedException
- if not alloweddefault void checkCanShowTablesMetadata(ConnectorTransactionHandle transactionHandle, Identity identity, 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.Identity, java.util.Set<com.facebook.presto.spi.SchemaTableName>)
method must filter all results for unauthorized users,
since there are multiple ways to list tables.
AccessDeniedException
- if not alloweddefault Set<SchemaTableName> filterTables(ConnectorTransactionHandle transactionHandle, Identity identity, Set<SchemaTableName> tableNames)
default void checkCanAddColumn(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanDropColumn(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanRenameColumn(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanSelectFromColumns(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName, Set<String> columnNames)
AccessDeniedException
- if not allowed@Deprecated default void checkCanSelectFromTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
checkCanSelectFromColumns(com.facebook.presto.spi.connector.ConnectorTransactionHandle, com.facebook.presto.spi.security.Identity, com.facebook.presto.spi.SchemaTableName, java.util.Set<java.lang.String>)
insteadAccessDeniedException
- if not alloweddefault void checkCanInsertIntoTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanDeleteFromTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not alloweddefault void checkCanCreateView(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName viewName)
AccessDeniedException
- if not alloweddefault void checkCanDropView(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName viewName)
AccessDeniedException
- if not allowed@Deprecated default void checkCanSelectFromView(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName viewName)
checkCanSelectFromColumns(com.facebook.presto.spi.connector.ConnectorTransactionHandle, com.facebook.presto.spi.security.Identity, com.facebook.presto.spi.SchemaTableName, java.util.Set<java.lang.String>)
insteadAccessDeniedException
- if not allowed@Deprecated default void checkCanCreateViewWithSelectFromTable(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName)
AccessDeniedException
- if not allowed@Deprecated default void checkCanCreateViewWithSelectFromView(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName viewName)
AccessDeniedException
- if not alloweddefault void checkCanCreateViewWithSelectFromColumns(ConnectorTransactionHandle transactionHandle, Identity identity, SchemaTableName tableName, Set<String> columnNames)
AccessDeniedException
- if not alloweddefault void checkCanSetCatalogSessionProperty(Identity identity, String propertyName)
AccessDeniedException
- if not alloweddefault void checkCanGrantTablePrivilege(ConnectorTransactionHandle transactionHandle, Identity identity, Privilege privilege, SchemaTableName tableName, String grantee, boolean withGrantOption)
AccessDeniedException
- if not alloweddefault void checkCanRevokeTablePrivilege(ConnectorTransactionHandle transactionHandle, Identity identity, Privilege privilege, SchemaTableName tableName, String revokee, boolean grantOptionFor)
AccessDeniedException
- if not allowedCopyright © 2012–2018. All rights reserved.