public interface AccessControl
| Modifier and Type | Method and Description |
|---|---|
void |
checkCanAccessCatalog(Identity identity,
String catalogName)
Check whether identity is allowed to access catalog
|
void |
checkCanAddColumns(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to add columns to the specified table.
|
void |
checkCanCreateRole(TransactionId transactionId,
Identity identity,
String role,
Optional<PrestoPrincipal> grantor,
String catalogName)
Check if identity is allowed to create the specified role.
|
void |
checkCanCreateSchema(TransactionId transactionId,
Identity identity,
CatalogSchemaName schemaName)
Check if identity is allowed to create the specified schema.
|
void |
checkCanCreateTable(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to create the specified table.
|
void |
checkCanCreateView(TransactionId transactionId,
Identity identity,
QualifiedObjectName viewName)
Check if identity is allowed to create the specified view.
|
void |
checkCanCreateViewWithSelectFromColumns(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName,
Set<String> columnNames)
Check if identity is allowed to create a view that selects from the specified columns.
|
void |
checkCanDeleteFromTable(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to delete from the specified table.
|
void |
checkCanDropColumn(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to drop columns from the specified table.
|
void |
checkCanDropRole(TransactionId transactionId,
Identity identity,
String role,
String catalogName)
Check if identity is allowed to drop the specified role.
|
void |
checkCanDropSchema(TransactionId transactionId,
Identity identity,
CatalogSchemaName schemaName)
Check if identity is allowed to drop the specified schema.
|
void |
checkCanDropTable(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to drop the specified table.
|
void |
checkCanDropView(TransactionId transactionId,
Identity identity,
QualifiedObjectName viewName)
Check if identity is allowed to drop the specified view.
|
void |
checkCanGrantRoles(TransactionId transactionId,
Identity identity,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean withAdminOption,
Optional<PrestoPrincipal> grantor,
String catalogName)
Check if identity is allowed to grant the specified roles to the specified principals.
|
void |
checkCanGrantTablePrivilege(TransactionId transactionId,
Identity identity,
Privilege privilege,
QualifiedObjectName tableName,
PrestoPrincipal grantee,
boolean withGrantOption)
Check if identity is allowed to grant a privilege to the grantee on the specified table.
|
void |
checkCanInsertIntoTable(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to insert into the specified table.
|
void |
checkCanRenameColumn(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to rename a column in the specified table.
|
void |
checkCanRenameSchema(TransactionId transactionId,
Identity identity,
CatalogSchemaName schemaName,
String newSchemaName)
Check if identity is allowed to rename the specified schema.
|
void |
checkCanRenameTable(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName,
QualifiedObjectName newTableName)
Check if identity is allowed to rename the specified table.
|
void |
checkCanRevokeRoles(TransactionId transactionId,
Identity identity,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean adminOptionFor,
Optional<PrestoPrincipal> grantor,
String catalogName)
Check if identity is allowed to revoke the specified roles from the specified principals.
|
void |
checkCanRevokeTablePrivilege(TransactionId transactionId,
Identity identity,
Privilege privilege,
QualifiedObjectName tableName,
PrestoPrincipal revokee,
boolean grantOptionFor)
Check if identity is allowed to revoke a privilege from the revokee on the specified table.
|
void |
checkCanSelectFromColumns(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName,
Set<String> columnNames)
Check if identity is allowed to select from the specified columns.
|
void |
checkCanSetCatalogSessionProperty(TransactionId transactionId,
Identity identity,
String catalogName,
String propertyName)
Check if identity is allowed to set the specified catalog property.
|
void |
checkCanSetRole(TransactionId requiredTransactionId,
Identity identity,
String role,
String catalog)
Check if identity is allowed to set role for specified catalog.
|
void |
checkCanSetSystemSessionProperty(Identity identity,
String propertyName)
Check if identity is allowed to set the specified system property.
|
void |
checkCanSetTableComment(TransactionId transactionId,
Identity identity,
QualifiedObjectName tableName)
Check if identity is allowed to comment the specified table.
|
void |
checkCanSetUser(Optional<Principal> principal,
String userName)
Check if the principal is allowed to be the specified user.
|
void |
checkCanShowColumnsMetadata(TransactionId transactionId,
Identity identity,
CatalogSchemaTableName table)
Check if identity is allowed to show columns of tables by executing SHOW COLUMNS, DESCRIBE etc.
|
void |
checkCanShowCurrentRoles(TransactionId transactionId,
Identity identity,
String catalogName)
Check if identity is allowed to show current roles on the specified catalog.
|
void |
checkCanShowRoleGrants(TransactionId transactionId,
Identity identity,
String catalogName)
Check if identity is allowed to show its own role grants on the specified catalog.
|
void |
checkCanShowRoles(TransactionId transactionId,
Identity identity,
String catalogName)
Check if identity is allowed to show roles on the specified catalog.
|
void |
checkCanShowSchemas(TransactionId transactionId,
Identity identity,
String catalogName)
Check if identity is allowed to execute SHOW SCHEMAS in a catalog.
|
void |
checkCanShowTablesMetadata(TransactionId transactionId,
Identity identity,
CatalogSchemaName schema)
Check if identity is allowed to show metadata of tables by executing SHOW TABLES, SHOW GRANTS etc.
|
Set<String> |
filterCatalogs(Identity identity,
Set<String> catalogs)
Filter the list of catalogs to those visible to the identity.
|
List<ColumnMetadata> |
filterColumns(TransactionId transactionId,
Identity identity,
CatalogSchemaTableName tableName,
List<ColumnMetadata> columns)
Filter the list of columns to those visible to the identity.
|
Set<String> |
filterSchemas(TransactionId transactionId,
Identity identity,
String catalogName,
Set<String> schemaNames)
Filter the list of schemas in a catalog to those visible to the identity.
|
Set<SchemaTableName> |
filterTables(TransactionId transactionId,
Identity identity,
String catalogName,
Set<SchemaTableName> tableNames)
Filter the list of tables and views to those visible to the identity.
|
void checkCanSetUser(Optional<Principal> principal, String userName)
AccessDeniedException - if not allowedSet<String> filterCatalogs(Identity identity, Set<String> catalogs)
void checkCanAccessCatalog(Identity identity, String catalogName)
void checkCanCreateSchema(TransactionId transactionId, Identity identity, CatalogSchemaName schemaName)
AccessDeniedException - if not allowedvoid checkCanDropSchema(TransactionId transactionId, Identity identity, CatalogSchemaName schemaName)
AccessDeniedException - if not allowedvoid checkCanRenameSchema(TransactionId transactionId, Identity identity, CatalogSchemaName schemaName, String newSchemaName)
AccessDeniedException - if not allowedvoid checkCanShowSchemas(TransactionId transactionId, Identity identity, String catalogName)
NOTE: This method is only present to give users an error message when listing is not allowed.
The filterSchemas(io.prestosql.transaction.TransactionId, io.prestosql.spi.security.Identity, java.lang.String, java.util.Set<java.lang.String>) method must filter all results for unauthorized users,
since there are multiple ways to list schemas.
AccessDeniedException - if not allowedSet<String> filterSchemas(TransactionId transactionId, Identity identity, String catalogName, Set<String> schemaNames)
void checkCanCreateTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanDropTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanRenameTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, QualifiedObjectName newTableName)
AccessDeniedException - if not allowedvoid checkCanSetTableComment(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanShowTablesMetadata(TransactionId transactionId, Identity identity, CatalogSchemaName schema)
NOTE: This method is only present to give users an error message when listing is not allowed.
The filterTables(io.prestosql.transaction.TransactionId, io.prestosql.spi.security.Identity, java.lang.String, java.util.Set<io.prestosql.spi.connector.SchemaTableName>) method must filter all results for unauthorized users,
since there are multiple ways to list tables.
AccessDeniedException - if not allowedSet<SchemaTableName> filterTables(TransactionId transactionId, Identity identity, String catalogName, Set<SchemaTableName> tableNames)
void checkCanShowColumnsMetadata(TransactionId transactionId, Identity identity, CatalogSchemaTableName table)
NOTE: This method is only present to give users an error message when listing is not allowed.
The filterColumns(io.prestosql.transaction.TransactionId, io.prestosql.spi.security.Identity, io.prestosql.spi.connector.CatalogSchemaTableName, java.util.List<io.prestosql.spi.connector.ColumnMetadata>) method must filter all results for unauthorized users,
since there are multiple ways to list columns.
AccessDeniedException - if not allowedList<ColumnMetadata> filterColumns(TransactionId transactionId, Identity identity, CatalogSchemaTableName tableName, List<ColumnMetadata> columns)
void checkCanAddColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanDropColumn(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanRenameColumn(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanInsertIntoTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanDeleteFromTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessDeniedException - if not allowedvoid checkCanCreateView(TransactionId transactionId, Identity identity, QualifiedObjectName viewName)
AccessDeniedException - if not allowedvoid checkCanDropView(TransactionId transactionId, Identity identity, QualifiedObjectName viewName)
AccessDeniedException - if not allowedvoid checkCanCreateViewWithSelectFromColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, Set<String> columnNames)
AccessDeniedException - if not allowedvoid checkCanGrantTablePrivilege(TransactionId transactionId, Identity identity, Privilege privilege, QualifiedObjectName tableName, PrestoPrincipal grantee, boolean withGrantOption)
AccessDeniedException - if not allowedvoid checkCanRevokeTablePrivilege(TransactionId transactionId, Identity identity, Privilege privilege, QualifiedObjectName tableName, PrestoPrincipal revokee, boolean grantOptionFor)
AccessDeniedException - if not allowedvoid checkCanSetSystemSessionProperty(Identity identity, String propertyName)
AccessDeniedException - if not allowedvoid checkCanSetCatalogSessionProperty(TransactionId transactionId, Identity identity, String catalogName, String propertyName)
AccessDeniedException - if not allowedvoid checkCanSelectFromColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, Set<String> columnNames)
AccessDeniedException - if not allowedvoid checkCanCreateRole(TransactionId transactionId, Identity identity, String role, Optional<PrestoPrincipal> grantor, String catalogName)
AccessDeniedException - if not allowedvoid checkCanDropRole(TransactionId transactionId, Identity identity, String role, String catalogName)
AccessDeniedException - if not allowedvoid checkCanGrantRoles(TransactionId transactionId, Identity identity, Set<String> roles, Set<PrestoPrincipal> grantees, boolean withAdminOption, Optional<PrestoPrincipal> grantor, String catalogName)
AccessDeniedException - if not allowedvoid checkCanRevokeRoles(TransactionId transactionId, Identity identity, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalogName)
AccessDeniedException - if not allowedvoid checkCanSetRole(TransactionId requiredTransactionId, Identity identity, String role, String catalog)
AccessDeniedException - if not allowedvoid checkCanShowRoles(TransactionId transactionId, Identity identity, String catalogName)
AccessDeniedException - if not allowedvoid checkCanShowCurrentRoles(TransactionId transactionId, Identity identity, String catalogName)
AccessDeniedException - if not allowedvoid checkCanShowRoleGrants(TransactionId transactionId, Identity identity, String catalogName)
AccessDeniedException - if not allowedCopyright © 2012–2019. All rights reserved.