Class AccessControlManager
- All Implemented Interfaces:
AccessControl
- Direct Known Subclasses:
TestingAccessControlManager
-
Constructor Summary
ConstructorsConstructorDescriptionAccessControlManager(NodeVersion nodeVersion, TransactionManager transactionManager, EventListenerManager eventListenerManager, AccessControlConfig config, io.opentelemetry.api.OpenTelemetry openTelemetry, String defaultAccessControlName) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddSystemAccessControlFactory(SystemAccessControlFactory accessControlFactory) booleancanCreateViewWithExecuteFunction(SecurityContext securityContext, QualifiedObjectName functionName) Is the identity allowed to create a view that executes the specified function?booleancanExecuteFunction(SecurityContext securityContext, QualifiedObjectName functionName) Is the identity allowed to execute function?voidcheckCanAddColumns(SecurityContext securityContext, QualifiedObjectName tableName) Check if identity is allowed to add columns to the specified table.voidcheckCanAlterColumn(SecurityContext securityContext, QualifiedObjectName tableName) Check if identity is allowed to alter columns to the specified table.voidcheckCanCreateCatalog(SecurityContext securityContext, String catalog) Check if identity is allowed to create the specified catalog.voidcheckCanCreateFunction(SecurityContext securityContext, QualifiedObjectName functionName) Check if identity is allowed to create the specified function.voidcheckCanCreateMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName, Map<String, Object> properties) Check if identity is allowed to create the specified materialized view.voidcheckCanCreateRole(SecurityContext securityContext, String role, Optional<TrinoPrincipal> grantor, Optional<String> catalogName) Check if identity is allowed to create the specified role.voidcheckCanCreateSchema(SecurityContext securityContext, CatalogSchemaName schemaName, Map<String, Object> properties) Check if identity is allowed to create the specified schema.voidcheckCanCreateTable(SecurityContext securityContext, QualifiedObjectName tableName, Map<String, Object> properties) Check if identity is allowed to create the specified table with properties.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.voidcheckCanDenySchemaPrivilege(SecurityContext securityContext, Privilege privilege, CatalogSchemaName schemaName, TrinoPrincipal grantee) Check if identity is allowed to deny a privilege to the grantee on the specified schema.voidcheckCanDenyTablePrivilege(SecurityContext securityContext, Privilege privilege, QualifiedObjectName tableName, TrinoPrincipal grantee) Check if identity is allowed to deny a privilege to the grantee on the specified table.voidcheckCanDropCatalog(SecurityContext securityContext, String catalog) Check if identity is allowed to drop the specified catalog.voidcheckCanDropColumn(SecurityContext securityContext, QualifiedObjectName tableName) Check if identity is allowed to drop columns from the specified table.voidcheckCanDropFunction(SecurityContext securityContext, QualifiedObjectName functionName) Check if identity is allowed to drop the specified function.voidcheckCanDropMaterializedView(SecurityContext securityContext, QualifiedObjectName materializedViewName) Check if identity is allowed to drop the specified materialized view.voidcheckCanDropRole(SecurityContext securityContext, String role, Optional<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.voidcheckCanExecuteProcedure(SecurityContext securityContext, QualifiedObjectName procedureName) Check if identity is allowed to execute procedurevoidcheckCanExecuteQuery(Identity identity) Checks if identity can execute a query.voidcheckCanExecuteTableProcedure(SecurityContext securityContext, QualifiedObjectName tableName, String procedureName) Check if identity is allowed to execute given table procedure on given tablevoidcheckCanGrantRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<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, Identity 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.voidcheckCanRenameMaterializedView(SecurityContext securityContext, QualifiedObjectName viewName, QualifiedObjectName newViewName) Check if identity is allowed to rename the specified materialized view.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, Optional<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.voidcheckCanSetCatalogRole(SecurityContext securityContext, String role, String catalogName) Check if identity is allowed to set role for specified catalog.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.voidcheckCanSetMaterializedViewProperties(SecurityContext securityContext, QualifiedObjectName materializedViewName, Map<String, Optional<Object>> properties) Check if identity is allowed to set the properties of the specified materialized view.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.voidcheckCanSetTableProperties(SecurityContext securityContext, QualifiedObjectName tableName, Map<String, Optional<Object>> properties) Check if identity is allowed to set properties to 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.voidcheckCanSetViewComment(SecurityContext securityContext, QualifiedObjectName viewName) Check if identity is allowed to comment the specified view.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, Optional<String> catalogName) Check if identity is allowed to show current roles on the specified catalog.voidcheckCanShowFunctions(SecurityContext securityContext, CatalogSchemaName schema) Check if identity is allowed to show functions by executing SHOW FUNCTIONS in a catalog schema.voidcheckCanShowRoleGrants(SecurityContext securityContext, Optional<String> catalogName) Check if identity is allowed to show its own role grants on the specified catalog.voidcheckCanShowRoles(SecurityContext securityContext, Optional<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.voidcheckCanTruncateTable(SecurityContext securityContext, QualifiedObjectName tableName) Check if identity is allowed to truncate the specified table.voidcheckCanUpdateTableColumns(SecurityContext securityContext, QualifiedObjectName tableName, Set<String> updatedColumnNames) Check if identity is allowed to update the specified table.voidcheckCanViewQueryOwnedBy(Identity identity, Identity 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.filterCatalogs(SecurityContext securityContext, Set<String> catalogs) Filter the list of catalogs to those visible to the identity.filterColumns(SecurityContext securityContext, String catalogName, Map<SchemaTableName, Set<String>> tableColumns) Filter lists of columns of multiple tables to those visible to the identity.filterFunctions(SecurityContext securityContext, String catalogName, Set<SchemaFunctionName> functionNames) Filter the list of functions to those visible to the identity.filterQueriesOwnedBy(Identity identity, Collection<Identity> queryOwners) Filter the list of users to those the identity view query owned by the user.filterSchemas(SecurityContext securityContext, String catalogName, Set<String> schemaNames) Filter the list of schemas in a catalog to those visible to the identity.filterTables(SecurityContext securityContext, String catalogName, Set<SchemaTableName> tableNames) Filter the list of tables, materialized views and views to those visible to the identity.io.airlift.stats.CounterStatio.airlift.stats.CounterStatgetColumnMask(SecurityContext context, QualifiedObjectName tableName, String columnName, Type type) getRowFilters(SecurityContext context, QualifiedObjectName tableName) voidvoidloadSystemAccessControl(String name, Map<String, String> properties) voidsetConnectorAccessControlProvider(CatalogServiceProvider<Optional<ConnectorAccessControl>> connectorAccessControlProvider) Lazy registry for connector access controls due to circular dependency between access control and connector creation in CatalogManager.voidsetSystemAccessControls(List<SystemAccessControl> systemAccessControls)
-
Constructor Details
-
AccessControlManager
@Inject public AccessControlManager(NodeVersion nodeVersion, TransactionManager transactionManager, EventListenerManager eventListenerManager, AccessControlConfig config, io.opentelemetry.api.OpenTelemetry openTelemetry, String defaultAccessControlName)
-
-
Method Details
-
addSystemAccessControlFactory
-
setConnectorAccessControlProvider
public void setConnectorAccessControlProvider(CatalogServiceProvider<Optional<ConnectorAccessControl>> connectorAccessControlProvider) Lazy registry for connector access controls due to circular dependency between access control and connector creation in CatalogManager. -
loadSystemAccessControl
public void loadSystemAccessControl() -
loadSystemAccessControl
-
setSystemAccessControls
-
checkCanImpersonateUser
Description copied from interface:AccessControlCheck if the identity is allowed impersonate the specified user.- Specified by:
checkCanImpersonateUserin interfaceAccessControl
-
checkCanSetUser
Deprecated.Description copied from interface:AccessControlCheck if the principal is allowed to be the specified user.- Specified by:
checkCanSetUserin interfaceAccessControl
-
checkCanReadSystemInformation
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
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
Description copied from interface:AccessControlChecks if identity can execute a query.- Specified by:
checkCanExecuteQueryin interfaceAccessControl
-
checkCanViewQueryOwnedBy
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 Collection<Identity> filterQueriesOwnedBy(Identity identity, Collection<Identity> 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
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
-
checkCanCreateCatalog
Description copied from interface:AccessControlCheck if identity is allowed to create the specified catalog.- Specified by:
checkCanCreateCatalogin interfaceAccessControl
-
checkCanDropCatalog
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified catalog.- Specified by:
checkCanDropCatalogin interfaceAccessControl
-
filterCatalogs
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, Map<String, Object> properties) Description copied from interface:AccessControlCheck if identity is allowed to create the specified schema.- Specified by:
checkCanCreateSchemain interfaceAccessControl
-
checkCanDropSchema
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
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
Description copied from interface:AccessControlCheck if identity is allowed to execute SHOW CREATE SCHEMA.- Specified by:
checkCanShowCreateSchemain interfaceAccessControl
-
checkCanShowCreateTable
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, Map<String, Object> properties) Description copied from interface:AccessControlCheck if identity is allowed to create the specified table with properties.- Specified by:
checkCanCreateTablein interfaceAccessControl
-
checkCanDropTable
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
-
checkCanSetTableProperties
public void checkCanSetTableProperties(SecurityContext securityContext, QualifiedObjectName tableName, Map<String, Optional<Object>> properties) Description copied from interface:AccessControlCheck if identity is allowed to set properties to the specified table.- Specified by:
checkCanSetTablePropertiesin interfaceAccessControl
-
checkCanSetTableComment
Description copied from interface:AccessControlCheck if identity is allowed to comment the specified table.- Specified by:
checkCanSetTableCommentin interfaceAccessControl
-
checkCanSetViewComment
Description copied from interface:AccessControlCheck if identity is allowed to comment the specified view.- Specified by:
checkCanSetViewCommentin 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
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, materialized views and views to those visible to the identity.- Specified by:
filterTablesin interfaceAccessControl
-
checkCanShowColumns
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, java.lang.String, java.util.Map<io.trino.spi.connector.SchemaTableName, 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 Map<SchemaTableName,Set<String>> filterColumns(SecurityContext securityContext, String catalogName, Map<SchemaTableName, Set<String>> tableColumns) Description copied from interface:AccessControlFilter lists of columns of multiple tables to those visible to the identity.- Specified by:
filterColumnsin interfaceAccessControl
-
checkCanAddColumns
Description copied from interface:AccessControlCheck if identity is allowed to add columns to the specified table.- Specified by:
checkCanAddColumnsin interfaceAccessControl
-
checkCanAlterColumn
Description copied from interface:AccessControlCheck if identity is allowed to alter columns to the specified table.- Specified by:
checkCanAlterColumnin interfaceAccessControl
-
checkCanDropColumn
Description copied from interface:AccessControlCheck if identity is allowed to drop columns from the specified table.- Specified by:
checkCanDropColumnin interfaceAccessControl
-
checkCanRenameColumn
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
Description copied from interface:AccessControlCheck if identity is allowed to insert into the specified table.- Specified by:
checkCanInsertIntoTablein interfaceAccessControl
-
checkCanDeleteFromTable
Description copied from interface:AccessControlCheck if identity is allowed to delete from the specified table.- Specified by:
checkCanDeleteFromTablein interfaceAccessControl
-
checkCanTruncateTable
Description copied from interface:AccessControlCheck if identity is allowed to truncate the specified table.- Specified by:
checkCanTruncateTablein 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
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
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, Map<String, Object> properties) 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
-
checkCanRenameMaterializedView
public void checkCanRenameMaterializedView(SecurityContext securityContext, QualifiedObjectName viewName, QualifiedObjectName newViewName) Description copied from interface:AccessControlCheck if identity is allowed to rename the specified materialized view.- Specified by:
checkCanRenameMaterializedViewin interfaceAccessControl
-
checkCanSetMaterializedViewProperties
public void checkCanSetMaterializedViewProperties(SecurityContext securityContext, QualifiedObjectName materializedViewName, Map<String, Optional<Object>> properties) Description copied from interface:AccessControlCheck if identity is allowed to set the properties of the specified materialized view.- Specified by:
checkCanSetMaterializedViewPropertiesin 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
-
checkCanDenySchemaPrivilege
public void checkCanDenySchemaPrivilege(SecurityContext securityContext, Privilege privilege, CatalogSchemaName schemaName, TrinoPrincipal grantee) Description copied from interface:AccessControlCheck if identity is allowed to deny a privilege to the grantee on the specified schema.- Specified by:
checkCanDenySchemaPrivilegein 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
-
checkCanDenyTablePrivilege
public void checkCanDenyTablePrivilege(SecurityContext securityContext, Privilege privilege, QualifiedObjectName tableName, TrinoPrincipal grantee) Description copied from interface:AccessControlCheck if identity is allowed to deny a privilege to the grantee on the specified table.- Specified by:
checkCanDenyTablePrivilegein 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
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, Optional<String> catalogName) Description copied from interface:AccessControlCheck if identity is allowed to create the specified role.- Specified by:
checkCanCreateRolein interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanDropRole
public void checkCanDropRole(SecurityContext securityContext, String role, Optional<String> catalogName) Description copied from interface:AccessControlCheck if identity is allowed to drop the specified role.- Specified by:
checkCanDropRolein interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanGrantRoles
public void checkCanGrantRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalogName) Description copied from interface:AccessControlCheck if identity is allowed to grant the specified roles to the specified principals.- Specified by:
checkCanGrantRolesin interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanRevokeRoles
public void checkCanRevokeRoles(SecurityContext securityContext, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalogName) Description copied from interface:AccessControlCheck if identity is allowed to revoke the specified roles from the specified principals.- Specified by:
checkCanRevokeRolesin interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanSetCatalogRole
public void checkCanSetCatalogRole(SecurityContext securityContext, String role, String catalogName) Description copied from interface:AccessControlCheck if identity is allowed to set role for specified catalog.- Specified by:
checkCanSetCatalogRolein interfaceAccessControl- Parameters:
catalogName- the role catalog
-
checkCanShowRoles
Description copied from interface:AccessControlCheck if identity is allowed to show roles on the specified catalog.- Specified by:
checkCanShowRolesin interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanShowCurrentRoles
Description copied from interface:AccessControlCheck if identity is allowed to show current roles on the specified catalog.- Specified by:
checkCanShowCurrentRolesin interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanShowRoleGrants
Description copied from interface:AccessControlCheck if identity is allowed to show its own role grants on the specified catalog.- Specified by:
checkCanShowRoleGrantsin interfaceAccessControl- Parameters:
catalogName- if present, the role catalog; otherwise the role is a system role
-
checkCanExecuteProcedure
public void checkCanExecuteProcedure(SecurityContext securityContext, QualifiedObjectName procedureName) Description copied from interface:AccessControlCheck if identity is allowed to execute procedure- Specified by:
checkCanExecuteProcedurein interfaceAccessControl
-
canExecuteFunction
public boolean canExecuteFunction(SecurityContext securityContext, QualifiedObjectName functionName) Description copied from interface:AccessControlIs the identity allowed to execute function?- Specified by:
canExecuteFunctionin interfaceAccessControl
-
canCreateViewWithExecuteFunction
public boolean canCreateViewWithExecuteFunction(SecurityContext securityContext, QualifiedObjectName functionName) Description copied from interface:AccessControlIs the identity allowed to create a view that executes the specified function?- Specified by:
canCreateViewWithExecuteFunctionin interfaceAccessControl
-
checkCanExecuteTableProcedure
public void checkCanExecuteTableProcedure(SecurityContext securityContext, QualifiedObjectName tableName, String procedureName) Description copied from interface:AccessControlCheck if identity is allowed to execute given table procedure on given table- Specified by:
checkCanExecuteTableProcedurein interfaceAccessControl
-
checkCanShowFunctions
Description copied from interface:AccessControlCheck if identity is allowed to show functions by executing SHOW FUNCTIONS in a catalog schema.NOTE: This method is only present to give users an error message when listing is not allowed. The
AccessControl.filterFunctions(io.trino.security.SecurityContext, java.lang.String, java.util.Set<io.trino.spi.function.SchemaFunctionName>)method must filter all results for unauthorized users, since there are multiple ways to list functions.- Specified by:
checkCanShowFunctionsin interfaceAccessControl
-
filterFunctions
public Set<SchemaFunctionName> filterFunctions(SecurityContext securityContext, String catalogName, Set<SchemaFunctionName> functionNames) Description copied from interface:AccessControlFilter the list of functions to those visible to the identity.- Specified by:
filterFunctionsin interfaceAccessControl
-
checkCanCreateFunction
public void checkCanCreateFunction(SecurityContext securityContext, QualifiedObjectName functionName) Description copied from interface:AccessControlCheck if identity is allowed to create the specified function.- Specified by:
checkCanCreateFunctionin interfaceAccessControl
-
checkCanDropFunction
Description copied from interface:AccessControlCheck if identity is allowed to drop the specified function.- Specified by:
checkCanDropFunctionin interfaceAccessControl
-
getRowFilters
- Specified by:
getRowFiltersin interfaceAccessControl
-
getColumnMask
public Optional<ViewExpression> getColumnMask(SecurityContext context, QualifiedObjectName tableName, String columnName, Type type) - Specified by:
getColumnMaskin interfaceAccessControl
-
getAuthorizationSuccess
public io.airlift.stats.CounterStat getAuthorizationSuccess() -
getAuthorizationFail
public io.airlift.stats.CounterStat getAuthorizationFail()
-