public class AllowAllAccessControl extends Object implements AccessControl
Constructor and Description |
---|
AllowAllAccessControl() |
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 |
checkCanSetUser(Optional<Principal> principal,
String userName)
Check if the principal is allowed to be the specified user.
|
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.
|
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.
|
public void checkCanSetUser(Optional<Principal> principal, String userName)
AccessControl
checkCanSetUser
in interface AccessControl
public Set<String> filterCatalogs(Identity identity, Set<String> catalogs)
AccessControl
filterCatalogs
in interface AccessControl
public void checkCanAccessCatalog(Identity identity, String catalogName)
AccessControl
checkCanAccessCatalog
in interface AccessControl
public void checkCanCreateSchema(TransactionId transactionId, Identity identity, CatalogSchemaName schemaName)
AccessControl
checkCanCreateSchema
in interface AccessControl
public void checkCanDropSchema(TransactionId transactionId, Identity identity, CatalogSchemaName schemaName)
AccessControl
checkCanDropSchema
in interface AccessControl
public void checkCanRenameSchema(TransactionId transactionId, Identity identity, CatalogSchemaName schemaName, String newSchemaName)
AccessControl
checkCanRenameSchema
in interface AccessControl
public void checkCanShowSchemas(TransactionId transactionId, Identity identity, String catalogName)
AccessControl
NOTE: This method is only present to give users an error message when listing is not allowed.
The AccessControl.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.
checkCanShowSchemas
in interface AccessControl
public Set<String> filterSchemas(TransactionId transactionId, Identity identity, String catalogName, Set<String> schemaNames)
AccessControl
filterSchemas
in interface AccessControl
public void checkCanCreateTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanCreateTable
in interface AccessControl
public void checkCanDropTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanDropTable
in interface AccessControl
public void checkCanRenameTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, QualifiedObjectName newTableName)
AccessControl
checkCanRenameTable
in interface AccessControl
public void checkCanShowTablesMetadata(TransactionId transactionId, Identity identity, CatalogSchemaName schema)
AccessControl
NOTE: This method is only present to give users an error message when listing is not allowed.
The AccessControl.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.
checkCanShowTablesMetadata
in interface AccessControl
public Set<SchemaTableName> filterTables(TransactionId transactionId, Identity identity, String catalogName, Set<SchemaTableName> tableNames)
AccessControl
filterTables
in interface AccessControl
public void checkCanAddColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanAddColumns
in interface AccessControl
public void checkCanDropColumn(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanDropColumn
in interface AccessControl
public void checkCanRenameColumn(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanRenameColumn
in interface AccessControl
public void checkCanInsertIntoTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanInsertIntoTable
in interface AccessControl
public void checkCanDeleteFromTable(TransactionId transactionId, Identity identity, QualifiedObjectName tableName)
AccessControl
checkCanDeleteFromTable
in interface AccessControl
public void checkCanCreateView(TransactionId transactionId, Identity identity, QualifiedObjectName viewName)
AccessControl
checkCanCreateView
in interface AccessControl
public void checkCanDropView(TransactionId transactionId, Identity identity, QualifiedObjectName viewName)
AccessControl
checkCanDropView
in interface AccessControl
public void checkCanCreateViewWithSelectFromColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, Set<String> columnNames)
AccessControl
checkCanCreateViewWithSelectFromColumns
in interface AccessControl
public void checkCanGrantTablePrivilege(TransactionId transactionId, Identity identity, Privilege privilege, QualifiedObjectName tableName, PrestoPrincipal grantee, boolean withGrantOption)
AccessControl
checkCanGrantTablePrivilege
in interface AccessControl
public void checkCanRevokeTablePrivilege(TransactionId transactionId, Identity identity, Privilege privilege, QualifiedObjectName tableName, PrestoPrincipal revokee, boolean grantOptionFor)
AccessControl
checkCanRevokeTablePrivilege
in interface AccessControl
public void checkCanSetSystemSessionProperty(Identity identity, String propertyName)
AccessControl
checkCanSetSystemSessionProperty
in interface AccessControl
public void checkCanSetCatalogSessionProperty(TransactionId transactionId, Identity identity, String catalogName, String propertyName)
AccessControl
checkCanSetCatalogSessionProperty
in interface AccessControl
public void checkCanSelectFromColumns(TransactionId transactionId, Identity identity, QualifiedObjectName tableName, Set<String> columnNames)
AccessControl
checkCanSelectFromColumns
in interface AccessControl
public void checkCanCreateRole(TransactionId transactionId, Identity identity, String role, Optional<PrestoPrincipal> grantor, String catalogName)
AccessControl
checkCanCreateRole
in interface AccessControl
public void checkCanDropRole(TransactionId transactionId, Identity identity, String role, String catalogName)
AccessControl
checkCanDropRole
in interface AccessControl
public void checkCanGrantRoles(TransactionId transactionId, Identity identity, Set<String> roles, Set<PrestoPrincipal> grantees, boolean withAdminOption, Optional<PrestoPrincipal> grantor, String catalogName)
AccessControl
checkCanGrantRoles
in interface AccessControl
public void checkCanRevokeRoles(TransactionId transactionId, Identity identity, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalogName)
AccessControl
checkCanRevokeRoles
in interface AccessControl
public void checkCanSetRole(TransactionId requiredTransactionId, Identity identity, String role, String catalog)
AccessControl
checkCanSetRole
in interface AccessControl
public void checkCanShowRoles(TransactionId transactionId, Identity identity, String catalogName)
AccessControl
checkCanShowRoles
in interface AccessControl
public void checkCanShowCurrentRoles(TransactionId transactionId, Identity identity, String catalogName)
AccessControl
checkCanShowCurrentRoles
in interface AccessControl
public void checkCanShowRoleGrants(TransactionId transactionId, Identity identity, String catalogName)
AccessControl
checkCanShowRoleGrants
in interface AccessControl
Copyright © 2012–2019. All rights reserved.