public interface ConnectorAccessControl
| Modifier and Type | Method and Description |
|---|---|
default 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.
|
default void |
checkCanCreateRole(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String role,
Optional<PrestoPrincipal> grantor) |
default void |
checkCanCreateSchema(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String schemaName)
Check if identity is allowed to create the specified schema in this catalog.
|
default void |
checkCanCreateTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to create the specified table in this catalog.
|
default void |
checkCanCreateView(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName viewName)
Check if identity is allowed to create the specified view in this catalog.
|
default 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.
|
default void |
checkCanDeleteFromTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to delete from the specified table in this catalog.
|
default 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.
|
default void |
checkCanDropRole(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String role) |
default void |
checkCanDropSchema(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String schemaName)
Check if identity is allowed to drop the specified schema in this catalog.
|
default void |
checkCanDropTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to drop the specified table in this catalog.
|
default void |
checkCanDropView(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName viewName)
Check if identity is allowed to drop the specified view in this catalog.
|
default void |
checkCanGrantRoles(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean withAdminOption,
Optional<PrestoPrincipal> grantor,
String catalogName) |
default void |
checkCanGrantTablePrivilege(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Privilege privilege,
SchemaTableName tableName,
PrestoPrincipal 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,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to insert into the specified table in this catalog.
|
default 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.
|
default void |
checkCanRenameSchema(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String schemaName,
String newSchemaName)
Check if identity is allowed to rename the specified schema in this catalog.
|
default 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.
|
default void |
checkCanRevokeRoles(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean adminOptionFor,
Optional<PrestoPrincipal> grantor,
String catalogName) |
default void |
checkCanRevokeTablePrivilege(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Privilege privilege,
SchemaTableName tableName,
PrestoPrincipal 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,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName,
Set<Subfield> columnOrSubfieldNames)
Check if identity is allowed to select from the specified columns.
|
default void |
checkCanSetCatalogSessionProperty(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String propertyName)
Check if identity is allowed to set the specified property in this catalog.
|
default void |
checkCanSetRole(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext accessControlContext,
String role,
String catalogName) |
default void |
checkCanShowCurrentRoles(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String catalogName)
Check if identity is allowed to show current roles on the specified catalog.
|
default void |
checkCanShowRoleGrants(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String catalogName)
Check if identity is allowed to show its own role grants on the specified catalog.
|
default void |
checkCanShowRoles(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
String catalogName)
Check if identity is allowed to show roles on the specified catalog.
|
default void |
checkCanShowSchemas(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context)
Check if identity is allowed to execute SHOW SCHEMAS in a catalog.
|
default 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.
|
default void |
checkCanTruncateTable(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
SchemaTableName tableName)
Check if identity is allowed to truncate the specified table in this catalog.
|
default Set<String> |
filterSchemas(ConnectorTransactionHandle transactionHandle,
ConnectorIdentity identity,
AccessControlContext context,
Set<String> schemaNames)
Filter the list of schemas to those visible to the identity.
|
default 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.
|
default void checkCanCreateSchema(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String schemaName)
AccessDeniedException - if not alloweddefault void checkCanDropSchema(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String schemaName)
AccessDeniedException - if not alloweddefault void checkCanRenameSchema(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String schemaName, String newSchemaName)
AccessDeniedException - if not alloweddefault 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.
AccessDeniedException - if not alloweddefault Set<String> filterSchemas(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Set<String> schemaNames)
default void checkCanCreateTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanDropTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanRenameTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName, SchemaTableName newTableName)
AccessDeniedException - if not alloweddefault 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.
AccessDeniedException - if not alloweddefault Set<SchemaTableName> filterTables(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Set<SchemaTableName> tableNames)
default void checkCanAddColumn(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanDropColumn(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanRenameColumn(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanSelectFromColumns(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName, Set<Subfield> columnOrSubfieldNames)
AccessDeniedException - if not alloweddefault void checkCanInsertIntoTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanDeleteFromTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanTruncateTable(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName)
AccessDeniedException - if not alloweddefault void checkCanCreateView(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName viewName)
AccessDeniedException - if not alloweddefault void checkCanDropView(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName viewName)
AccessDeniedException - if not alloweddefault void checkCanCreateViewWithSelectFromColumns(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, SchemaTableName tableName, Set<String> columnNames)
AccessDeniedException - if not alloweddefault void checkCanSetCatalogSessionProperty(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String propertyName)
AccessDeniedException - if not alloweddefault void checkCanGrantTablePrivilege(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Privilege privilege, SchemaTableName tableName, PrestoPrincipal grantee, boolean withGrantOption)
AccessDeniedException - if not alloweddefault void checkCanRevokeTablePrivilege(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Privilege privilege, SchemaTableName tableName, PrestoPrincipal revokee, boolean grantOptionFor)
AccessDeniedException - if not alloweddefault void checkCanCreateRole(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String role, Optional<PrestoPrincipal> grantor)
default void checkCanDropRole(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String role)
default void checkCanGrantRoles(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Set<String> roles, Set<PrestoPrincipal> grantees, boolean withAdminOption, Optional<PrestoPrincipal> grantor, String catalogName)
default void checkCanRevokeRoles(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalogName)
default void checkCanSetRole(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext accessControlContext, String role, String catalogName)
default void checkCanShowRoles(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String catalogName)
AccessDeniedException - if not alloweddefault void checkCanShowCurrentRoles(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String catalogName)
AccessDeniedException - if not alloweddefault void checkCanShowRoleGrants(ConnectorTransactionHandle transactionHandle, ConnectorIdentity identity, AccessControlContext context, String catalogName)
AccessDeniedException - if not allowedCopyright © 2012–2022. All rights reserved.