Class AccessControlManager
- java.lang.Object
-
- io.trino.security.AccessControlManager
-
- All Implemented Interfaces:
AccessControl
- Direct Known Subclasses:
TestingAccessControlManager
public class AccessControlManager extends Object implements AccessControl
-
-
Constructor Summary
Constructors Constructor Description AccessControlManager(TransactionManager transactionManager, EventListenerManager eventListenerManager, AccessControlConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCatalogAccessControl(CatalogName catalogName, ConnectorAccessControl accessControl)voidaddSystemAccessControl(SystemAccessControl systemAccessControl)voidaddSystemAccessControlFactory(SystemAccessControlFactory accessControlFactory)voidcheckCanAddColumns(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to add columns to the specified table.voidcheckCanCreateMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName)Check if identity is allowed to create the specified materialized view.voidcheckCanCreateRole(SecurityContext securityContext, String role, Optional<TrinoPrincipal> grantor, String catalogName)Check if identity is allowed to create the specified role.voidcheckCanCreateSchema(SecurityContext securityContext, CatalogSchemaName schemaName)Check if identity is allowed to create the specified schema.voidcheckCanCreateTable(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to create the specified table.voidcheckCanCreateView(SecurityContext securityContext, QualifiedObjectName viewName)Check if identity is allowed to create the specified view.voidcheckCanCreateViewWithSelectFromColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> columnNames)Check if identity is allowed to create a view that selects from the specified columns.voidcheckCanDeleteFromTable(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to delete from the specified table.voidcheckCanDropColumn(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to drop columns from the specified table.voidcheckCanDropMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName)Check if identity is allowed to drop the specified materialized view.voidcheckCanDropRole(SecurityContext securityContext, String role, String catalogName)Check if identity is allowed to drop the specified role.voidcheckCanDropSchema(SecurityContext securityContext, CatalogSchemaName schemaName)Check if identity is allowed to drop the specified schema.voidcheckCanDropTable(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to drop the specified table.voidcheckCanDropView(SecurityContext securityContext, QualifiedObjectName viewName)Check if identity is allowed to drop the specified view.voidcheckCanExecuteFunction(SecurityContext context, String functionName)Check if identity is allowed to execute functionvoidcheckCanExecuteProcedure(SecurityContext securityContext, QualifiedObjectName procedureName)Check if identity is allowed to execute procedurevoidcheckCanExecuteQuery(Identity identity)Checks if identity can execute a query.voidcheckCanGrantExecuteFunctionPrivilege(SecurityContext securityContext, String functionName, Identity grantee, boolean grantOption)Check if identity is allowed to create a view that executes the function.voidcheckCanGrantRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, String catalogName)Check if identity is allowed to grant the specified roles to the specified principals.voidcheckCanGrantSchemaPrivilege(SecurityContext securityContext, Privilege privilege, CatalogSchemaName schemaName, TrinoPrincipal grantee, boolean grantOption)Check if identity is allowed to grant a privilege to the grantee on the specified schema.voidcheckCanGrantTablePrivilege(SecurityContext securityContext, Privilege privilege, QualifiedObjectName tableName, TrinoPrincipal grantee, boolean grantOption)Check if identity is allowed to grant a privilege to the grantee on the specified table.voidcheckCanImpersonateUser(Identity identity, String userName)Check if the identity is allowed impersonate the specified user.voidcheckCanInsertIntoTable(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to insert into the specified table.voidcheckCanKillQueryOwnedBy(Identity identity, String queryOwner)Checks if identity can kill a query owned by the specified user.voidcheckCanReadSystemInformation(Identity identity)Check if identity is allowed to read system information such as statistics, service registry, thread stacks, etc.voidcheckCanRefreshMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName)Check if identity is allowed to refresh the specified materialized view.voidcheckCanRenameColumn(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to rename a column in the specified table.voidcheckCanRenameSchema(SecurityContext securityContext, CatalogSchemaName schemaName, String newSchemaName)Check if identity is allowed to rename the specified schema.voidcheckCanRenameTable(SecurityContext securityContext, QualifiedObjectName tableName, QualifiedObjectName newTableName)Check if identity is allowed to rename the specified table.voidcheckCanRenameView(SecurityContext securityContext, QualifiedObjectName viewName, QualifiedObjectName newViewName)Check if identity is allowed to rename the specified view.voidcheckCanRevokeRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, String catalogName)Check if identity is allowed to revoke the specified roles from the specified principals.voidcheckCanRevokeSchemaPrivilege(SecurityContext securityContext, Privilege privilege, CatalogSchemaName schemaName, TrinoPrincipal revokee, boolean grantOption)Check if identity is allowed to revoke a privilege from the revokee on the specified schema.voidcheckCanRevokeTablePrivilege(SecurityContext securityContext, Privilege privilege, QualifiedObjectName tableName, TrinoPrincipal revokee, boolean grantOption)Check if identity is allowed to revoke a privilege from the revokee on the specified table.voidcheckCanSelectFromColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> columnNames)Check if identity is allowed to select from the specified columns.voidcheckCanSetCatalogSessionProperty(SecurityContext securityContext, String catalogName, String propertyName)Check if identity is allowed to set the specified catalog property.voidcheckCanSetColumnComment(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to comment the specified column.voidcheckCanSetRole(SecurityContext securityContext, String role, String catalogName)Check if identity is allowed to set role for specified catalog.voidcheckCanSetSchemaAuthorization(SecurityContext securityContext, CatalogSchemaName schemaName, TrinoPrincipal principal)Check if identity is allowed to change the specified schema's user/role.voidcheckCanSetSystemSessionProperty(Identity identity, String propertyName)Check if identity is allowed to set the specified system property.voidcheckCanSetTableAuthorization(SecurityContext securityContext, QualifiedObjectName tableName, TrinoPrincipal principal)Check if identity is allowed to change the specified table's user/role.voidcheckCanSetTableComment(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to comment the specified table.voidcheckCanSetUser(Optional<Principal> principal, String userName)Deprecated.voidcheckCanSetViewAuthorization(SecurityContext securityContext, QualifiedObjectName viewName, TrinoPrincipal principal)Check if identity is allowed to change the specified view's user/role.voidcheckCanShowColumns(SecurityContext securityContext, CatalogSchemaTableName table)Check if identity is allowed to show columns of tables by executing SHOW COLUMNS, DESCRIBE etc.voidcheckCanShowCreateSchema(SecurityContext securityContext, CatalogSchemaName schemaName)Check if identity is allowed to execute SHOW CREATE SCHEMA.voidcheckCanShowCreateTable(SecurityContext securityContext, QualifiedObjectName tableName)Check if identity is allowed to execute SHOW CREATE TABLE, SHOW CREATE VIEW or SHOW CREATE MATERIALIZED VIEWvoidcheckCanShowCurrentRoles(SecurityContext securityContext, String catalogName)Check if identity is allowed to show current roles on the specified catalog.voidcheckCanShowRoleAuthorizationDescriptors(SecurityContext securityContext, String catalogName)Check if identity is allowed to show role authorization descriptors (i.e.voidcheckCanShowRoleGrants(SecurityContext securityContext, String catalogName)Check if identity is allowed to show its own role grants on the specified catalog.voidcheckCanShowRoles(SecurityContext securityContext, String catalogName)Check if identity is allowed to show roles on the specified catalog.voidcheckCanShowSchemas(SecurityContext securityContext, String catalogName)Check if identity is allowed to execute SHOW SCHEMAS in a catalog.voidcheckCanShowTables(SecurityContext securityContext, CatalogSchemaName schema)Check if identity is allowed to show tables by executing SHOW TABLES, SHOW GRANTS etc.voidcheckCanUpdateTableColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> updatedColumnNames)Check if identity is allowed to update the specified table.voidcheckCanViewQueryOwnedBy(Identity identity, String queryOwner)Checks if identity can view a query owned by the specified user.voidcheckCanWriteSystemInformation(Identity identity)Check if identity is allowed to write system information such as marking nodes offline, or changing runtime flags.Set<String>filterCatalogs(Identity identity, Set<String> catalogs)Filter the list of catalogs to those visible to the identity.Set<String>filterColumns(SecurityContext securityContext, CatalogSchemaTableName table, Set<String> columns)Filter the list of columns to those visible to the identity.Set<String>filterQueriesOwnedBy(Identity identity, Set<String> queryOwners)Filter the list of users to those the identity view query owned by the user.Set<String>filterSchemas(SecurityContext securityContext, String catalogName, Set<String> schemaNames)Filter the list of schemas in a catalog to those visible to the identity.Set<SchemaTableName>filterTables(SecurityContext securityContext, String catalogName, Set<SchemaTableName> tableNames)Filter the list of tables and views to those visible to the identity.io.airlift.stats.CounterStatgetAuthorizationFail()io.airlift.stats.CounterStatgetAuthorizationSuccess()List<ViewExpression>getColumnMasks(SecurityContext context, QualifiedObjectName tableName, String columnName, Type type)List<ViewExpression>getRowFilters(SecurityContext context, QualifiedObjectName tableName)voidloadSystemAccessControl()voidremoveCatalogAccessControl(CatalogName catalogName)protected voidsetSystemAccessControl(String name, Map<String,String> properties)voidsetSystemAccessControls(List<SystemAccessControl> systemAccessControls)
-
-
-
Constructor Detail
-
AccessControlManager
@Inject public AccessControlManager(TransactionManager transactionManager, EventListenerManager eventListenerManager, AccessControlConfig config)
-
-
Method Detail
-
addSystemAccessControlFactory
public final void addSystemAccessControlFactory(SystemAccessControlFactory accessControlFactory)
-
addCatalogAccessControl
public void addCatalogAccessControl(CatalogName catalogName, ConnectorAccessControl accessControl)
-
removeCatalogAccessControl
public void removeCatalogAccessControl(CatalogName catalogName)
-
loadSystemAccessControl
public void loadSystemAccessControl()
-
setSystemAccessControl
protected void setSystemAccessControl(String name, Map<String,String> properties)
-
addSystemAccessControl
public void addSystemAccessControl(SystemAccessControl systemAccessControl)
-
setSystemAccessControls
public void setSystemAccessControls(List<SystemAccessControl> systemAccessControls)
-
checkCanImpersonateUser
public void checkCanImpersonateUser(Identity identity, String userName)
Description copied from interface:AccessControlCheck if the identity is allowed impersonate the specified user.- Specified by:
checkCanImpersonateUserin interfaceAccessControl
-
checkCanSetUser
@Deprecated public void checkCanSetUser(Optional<Principal> principal, String userName)
Deprecated.Description copied from interface:AccessControlCheck if the principal is allowed to be the specified user.- Specified by:
checkCanSetUserin interfaceAccessControl
-
checkCanReadSystemInformation
public void checkCanReadSystemInformation(Identity identity)
Description copied from interface:AccessControlCheck if identity is allowed to read system information such as statistics, service registry, thread stacks, etc. This is typically allowed for administrators and management tools.- Specified by:
checkCanReadSystemInformationin interfaceAccessControl
-
checkCanWriteSystemInformation
public void checkCanWriteSystemInformation(Identity identity)
Description copied from interface:AccessControlCheck if identity is allowed to write system information such as marking nodes offline, or changing runtime flags. This is typically allowed for administrators.- Specified by:
checkCanWriteSystemInformationin interfaceAccessControl
-
checkCanExecuteQuery
public void checkCanExecuteQuery(Identity identity)
Description copied from interface:AccessControlChecks if identity can execute a query.- Specified by:
checkCanExecuteQueryin interfaceAccessControl
-
checkCanViewQueryOwnedBy
public void checkCanViewQueryOwnedBy(Identity identity, String queryOwner)
Description copied from interface:AccessControlChecks if identity can view a query owned by the specified user. The method will not be called when the current user is the query owner.- Specified by:
checkCanViewQueryOwnedByin interfaceAccessControl
-
filterQueriesOwnedBy
public Set<String> filterQueriesOwnedBy(Identity identity, Set<String> queryOwners)
Description copied from interface:AccessControlFilter the list of users to those the identity view query owned by the user. The method will not be called with the current user in the set.- Specified by:
filterQueriesOwnedByin interfaceAccessControl
-
checkCanKillQueryOwnedBy
public void checkCanKillQueryOwnedBy(Identity identity, String queryOwner)
Description copied from interface:AccessControlChecks if identity can kill a query owned by the specified user. The method will not be called when the current user is the query owner.- Specified by:
checkCanKillQueryOwnedByin interfaceAccessControl
-
filterCatalogs
public Set<String> filterCatalogs(Identity identity, Set<String> catalogs)
Description copied from interface:AccessControlFilter the list of catalogs to those visible to the identity.- Specified by:
filterCatalogsin interfaceAccessControl
-
checkCanCreateSchema
public void checkCanCreateSchema(SecurityContext securityContext, CatalogSchemaName schemaName)
Description copied from interface:AccessControlCheck if identity is allowed to create the specified schema.- Specified by:
checkCanCreateSchemain interfaceAccessControl
-
checkCanDropSchema
public void checkCanDropSchema(SecurityContext securityContext, CatalogSchemaName schemaName)
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified schema.- Specified by:
checkCanDropSchemain interfaceAccessControl
-
checkCanRenameSchema
public void checkCanRenameSchema(SecurityContext securityContext, CatalogSchemaName schemaName, String newSchemaName)
Description copied from interface:AccessControlCheck if identity is allowed to rename the specified schema.- Specified by:
checkCanRenameSchemain interfaceAccessControl
-
checkCanSetSchemaAuthorization
public void checkCanSetSchemaAuthorization(SecurityContext securityContext, CatalogSchemaName schemaName, TrinoPrincipal principal)
Description copied from interface:AccessControlCheck if identity is allowed to change the specified schema's user/role.- Specified by:
checkCanSetSchemaAuthorizationin interfaceAccessControl
-
checkCanShowSchemas
public void checkCanShowSchemas(SecurityContext securityContext, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to execute SHOW SCHEMAS in a catalog.NOTE: This method is only present to give users an error message when listing is not allowed. The
AccessControl.filterSchemas(io.trino.security.SecurityContext, 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.- Specified by:
checkCanShowSchemasin interfaceAccessControl
-
filterSchemas
public Set<String> filterSchemas(SecurityContext securityContext, String catalogName, Set<String> schemaNames)
Description copied from interface:AccessControlFilter the list of schemas in a catalog to those visible to the identity.- Specified by:
filterSchemasin interfaceAccessControl
-
checkCanShowCreateSchema
public void checkCanShowCreateSchema(SecurityContext securityContext, CatalogSchemaName schemaName)
Description copied from interface:AccessControlCheck if identity is allowed to execute SHOW CREATE SCHEMA.- Specified by:
checkCanShowCreateSchemain interfaceAccessControl
-
checkCanShowCreateTable
public void checkCanShowCreateTable(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to execute SHOW CREATE TABLE, SHOW CREATE VIEW or SHOW CREATE MATERIALIZED VIEW- Specified by:
checkCanShowCreateTablein interfaceAccessControl
-
checkCanCreateTable
public void checkCanCreateTable(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to create the specified table.- Specified by:
checkCanCreateTablein interfaceAccessControl
-
checkCanDropTable
public void checkCanDropTable(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified table.- Specified by:
checkCanDropTablein interfaceAccessControl
-
checkCanRenameTable
public void checkCanRenameTable(SecurityContext securityContext, QualifiedObjectName tableName, QualifiedObjectName newTableName)
Description copied from interface:AccessControlCheck if identity is allowed to rename the specified table.- Specified by:
checkCanRenameTablein interfaceAccessControl
-
checkCanSetTableComment
public void checkCanSetTableComment(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to comment the specified table.- Specified by:
checkCanSetTableCommentin interfaceAccessControl
-
checkCanSetColumnComment
public void checkCanSetColumnComment(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to comment the specified column.- Specified by:
checkCanSetColumnCommentin interfaceAccessControl
-
checkCanShowTables
public void checkCanShowTables(SecurityContext securityContext, CatalogSchemaName schema)
Description copied from interface:AccessControlCheck if identity is allowed to show tables by executing SHOW TABLES, SHOW GRANTS etc. in a catalog schema.NOTE: This method is only present to give users an error message when listing is not allowed. The
AccessControl.filterTables(io.trino.security.SecurityContext, java.lang.String, java.util.Set<io.trino.spi.connector.SchemaTableName>)method must filter all results for unauthorized users, since there are multiple ways to list tables.- Specified by:
checkCanShowTablesin interfaceAccessControl
-
filterTables
public Set<SchemaTableName> filterTables(SecurityContext securityContext, String catalogName, Set<SchemaTableName> tableNames)
Description copied from interface:AccessControlFilter the list of tables and views to those visible to the identity.- Specified by:
filterTablesin interfaceAccessControl
-
checkCanShowColumns
public void checkCanShowColumns(SecurityContext securityContext, CatalogSchemaTableName table)
Description copied from interface:AccessControlCheck if identity is allowed to show columns of tables by executing SHOW COLUMNS, DESCRIBE etc.NOTE: This method is only present to give users an error message when listing is not allowed. The
AccessControl.filterColumns(io.trino.security.SecurityContext, io.trino.spi.connector.CatalogSchemaTableName, java.util.Set<java.lang.String>)method must filter all results for unauthorized users, since there are multiple ways to list columns.- Specified by:
checkCanShowColumnsin interfaceAccessControl
-
filterColumns
public Set<String> filterColumns(SecurityContext securityContext, CatalogSchemaTableName table, Set<String> columns)
Description copied from interface:AccessControlFilter the list of columns to those visible to the identity.- Specified by:
filterColumnsin interfaceAccessControl
-
checkCanAddColumns
public void checkCanAddColumns(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to add columns to the specified table.- Specified by:
checkCanAddColumnsin interfaceAccessControl
-
checkCanDropColumn
public void checkCanDropColumn(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to drop columns from the specified table.- Specified by:
checkCanDropColumnin interfaceAccessControl
-
checkCanRenameColumn
public void checkCanRenameColumn(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to rename a column in the specified table.- Specified by:
checkCanRenameColumnin interfaceAccessControl
-
checkCanSetTableAuthorization
public void checkCanSetTableAuthorization(SecurityContext securityContext, QualifiedObjectName tableName, TrinoPrincipal principal)
Description copied from interface:AccessControlCheck if identity is allowed to change the specified table's user/role.- Specified by:
checkCanSetTableAuthorizationin interfaceAccessControl
-
checkCanInsertIntoTable
public void checkCanInsertIntoTable(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to insert into the specified table.- Specified by:
checkCanInsertIntoTablein interfaceAccessControl
-
checkCanDeleteFromTable
public void checkCanDeleteFromTable(SecurityContext securityContext, QualifiedObjectName tableName)
Description copied from interface:AccessControlCheck if identity is allowed to delete from the specified table.- Specified by:
checkCanDeleteFromTablein interfaceAccessControl
-
checkCanUpdateTableColumns
public void checkCanUpdateTableColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> updatedColumnNames)
Description copied from interface:AccessControlCheck if identity is allowed to update the specified table.- Specified by:
checkCanUpdateTableColumnsin interfaceAccessControl
-
checkCanCreateView
public void checkCanCreateView(SecurityContext securityContext, QualifiedObjectName viewName)
Description copied from interface:AccessControlCheck if identity is allowed to create the specified view.- Specified by:
checkCanCreateViewin interfaceAccessControl
-
checkCanRenameView
public void checkCanRenameView(SecurityContext securityContext, QualifiedObjectName viewName, QualifiedObjectName newViewName)
Description copied from interface:AccessControlCheck if identity is allowed to rename the specified view.- Specified by:
checkCanRenameViewin interfaceAccessControl
-
checkCanSetViewAuthorization
public void checkCanSetViewAuthorization(SecurityContext securityContext, QualifiedObjectName viewName, TrinoPrincipal principal)
Description copied from interface:AccessControlCheck if identity is allowed to change the specified view's user/role.- Specified by:
checkCanSetViewAuthorizationin interfaceAccessControl
-
checkCanDropView
public void checkCanDropView(SecurityContext securityContext, QualifiedObjectName viewName)
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified view.- Specified by:
checkCanDropViewin interfaceAccessControl
-
checkCanCreateViewWithSelectFromColumns
public void checkCanCreateViewWithSelectFromColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> columnNames)
Description copied from interface:AccessControlCheck if identity is allowed to create a view that selects from the specified columns.- Specified by:
checkCanCreateViewWithSelectFromColumnsin interfaceAccessControl
-
checkCanCreateMaterializedView
public void checkCanCreateMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName)
Description copied from interface:AccessControlCheck if identity is allowed to create the specified materialized view.- Specified by:
checkCanCreateMaterializedViewin interfaceAccessControl
-
checkCanRefreshMaterializedView
public void checkCanRefreshMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName)
Description copied from interface:AccessControlCheck if identity is allowed to refresh the specified materialized view.- Specified by:
checkCanRefreshMaterializedViewin interfaceAccessControl
-
checkCanDropMaterializedView
public void checkCanDropMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName)
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified materialized view.- Specified by:
checkCanDropMaterializedViewin interfaceAccessControl
-
checkCanGrantExecuteFunctionPrivilege
public void checkCanGrantExecuteFunctionPrivilege(SecurityContext securityContext, String functionName, Identity grantee, boolean grantOption)
Description copied from interface:AccessControlCheck if identity is allowed to create a view that executes the function.- Specified by:
checkCanGrantExecuteFunctionPrivilegein interfaceAccessControl
-
checkCanGrantSchemaPrivilege
public void checkCanGrantSchemaPrivilege(SecurityContext securityContext, Privilege privilege, CatalogSchemaName schemaName, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:AccessControlCheck if identity is allowed to grant a privilege to the grantee on the specified schema.- Specified by:
checkCanGrantSchemaPrivilegein interfaceAccessControl
-
checkCanRevokeSchemaPrivilege
public void checkCanRevokeSchemaPrivilege(SecurityContext securityContext, Privilege privilege, CatalogSchemaName schemaName, TrinoPrincipal revokee, boolean grantOption)
Description copied from interface:AccessControlCheck if identity is allowed to revoke a privilege from the revokee on the specified schema.- Specified by:
checkCanRevokeSchemaPrivilegein interfaceAccessControl
-
checkCanGrantTablePrivilege
public void checkCanGrantTablePrivilege(SecurityContext securityContext, Privilege privilege, QualifiedObjectName tableName, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:AccessControlCheck if identity is allowed to grant a privilege to the grantee on the specified table.- Specified by:
checkCanGrantTablePrivilegein interfaceAccessControl
-
checkCanRevokeTablePrivilege
public void checkCanRevokeTablePrivilege(SecurityContext securityContext, Privilege privilege, QualifiedObjectName tableName, TrinoPrincipal revokee, boolean grantOption)
Description copied from interface:AccessControlCheck if identity is allowed to revoke a privilege from the revokee on the specified table.- Specified by:
checkCanRevokeTablePrivilegein interfaceAccessControl
-
checkCanSetSystemSessionProperty
public void checkCanSetSystemSessionProperty(Identity identity, String propertyName)
Description copied from interface:AccessControlCheck if identity is allowed to set the specified system property.- Specified by:
checkCanSetSystemSessionPropertyin interfaceAccessControl
-
checkCanSetCatalogSessionProperty
public void checkCanSetCatalogSessionProperty(SecurityContext securityContext, String catalogName, String propertyName)
Description copied from interface:AccessControlCheck if identity is allowed to set the specified catalog property.- Specified by:
checkCanSetCatalogSessionPropertyin interfaceAccessControl
-
checkCanSelectFromColumns
public void checkCanSelectFromColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> columnNames)
Description copied from interface:AccessControlCheck if identity is allowed to select from the specified columns. The column set can be empty.- Specified by:
checkCanSelectFromColumnsin interfaceAccessControl
-
checkCanCreateRole
public void checkCanCreateRole(SecurityContext securityContext, String role, Optional<TrinoPrincipal> grantor, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to create the specified role.- Specified by:
checkCanCreateRolein interfaceAccessControl
-
checkCanDropRole
public void checkCanDropRole(SecurityContext securityContext, String role, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified role.- Specified by:
checkCanDropRolein interfaceAccessControl
-
checkCanGrantRoles
public void checkCanGrantRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to grant the specified roles to the specified principals.- Specified by:
checkCanGrantRolesin interfaceAccessControl
-
checkCanRevokeRoles
public void checkCanRevokeRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to revoke the specified roles from the specified principals.- Specified by:
checkCanRevokeRolesin interfaceAccessControl
-
checkCanSetRole
public void checkCanSetRole(SecurityContext securityContext, String role, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to set role for specified catalog.- Specified by:
checkCanSetRolein interfaceAccessControl
-
checkCanShowRoleAuthorizationDescriptors
public void checkCanShowRoleAuthorizationDescriptors(SecurityContext securityContext, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to show role authorization descriptors (i.e. RoleGrants).- Specified by:
checkCanShowRoleAuthorizationDescriptorsin interfaceAccessControl
-
checkCanShowRoles
public void checkCanShowRoles(SecurityContext securityContext, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to show roles on the specified catalog.- Specified by:
checkCanShowRolesin interfaceAccessControl
-
checkCanShowCurrentRoles
public void checkCanShowCurrentRoles(SecurityContext securityContext, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to show current roles on the specified catalog.- Specified by:
checkCanShowCurrentRolesin interfaceAccessControl
-
checkCanShowRoleGrants
public void checkCanShowRoleGrants(SecurityContext securityContext, String catalogName)
Description copied from interface:AccessControlCheck if identity is allowed to show its own role grants on the specified catalog.- Specified by:
checkCanShowRoleGrantsin interfaceAccessControl
-
checkCanExecuteProcedure
public void checkCanExecuteProcedure(SecurityContext securityContext, QualifiedObjectName procedureName)
Description copied from interface:AccessControlCheck if identity is allowed to execute procedure- Specified by:
checkCanExecuteProcedurein interfaceAccessControl
-
checkCanExecuteFunction
public void checkCanExecuteFunction(SecurityContext context, String functionName)
Description copied from interface:AccessControlCheck if identity is allowed to execute function- Specified by:
checkCanExecuteFunctionin interfaceAccessControl
-
getRowFilters
public List<ViewExpression> getRowFilters(SecurityContext context, QualifiedObjectName tableName)
- Specified by:
getRowFiltersin interfaceAccessControl
-
getColumnMasks
public List<ViewExpression> getColumnMasks(SecurityContext context, QualifiedObjectName tableName, String columnName, Type type)
- Specified by:
getColumnMasksin interfaceAccessControl
-
getAuthorizationSuccess
public io.airlift.stats.CounterStat getAuthorizationSuccess()
-
getAuthorizationFail
public io.airlift.stats.CounterStat getAuthorizationFail()
-
-