Package io.trino.metadata
Class DisabledSystemSecurityMetadata
- java.lang.Object
-
- io.trino.metadata.DisabledSystemSecurityMetadata
-
- All Implemented Interfaces:
SystemSecurityMetadata
public class DisabledSystemSecurityMetadata extends Object implements SystemSecurityMetadata
-
-
Constructor Summary
Constructors Constructor Description DisabledSystemSecurityMetadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateRole(Session session, String role, Optional<TrinoPrincipal> grantor)Creates the specified role.voiddenySchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee)Denys the specified privilege to the specified user on the specified schema.voiddenyTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee)Denys the specified privilege to the specified user on the specified tablevoiddropRole(Session session, String role)Drops the specified role.Optional<TrinoPrincipal>getSchemaOwner(Session session, CatalogSchemaName schema)Set the owner of the specified schemaOptional<Identity>getViewRunAsIdentity(Session session, CatalogSchemaTableName view)Get the identity to run the view asvoidgrantRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor)Grants the specified roles to the specified grantees.voidgrantSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Grants the specified privilege to the specified user on the specified schema.voidgrantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Grants the specified privilege to the specified user on the specified tableSet<RoleGrant>listAllRoleGrants(Session session, Optional<Set<String>> roles, Optional<Set<String>> grantees, OptionalLong limit)List all role grants, optionally filtered by passed role, grantee, and limit predicates.Set<RoleGrant>listApplicableRoles(Session session, TrinoPrincipal principal)List applicable roles, including the transitive grants, for the specified principalSet<String>listEnabledRoles(Identity identity)List applicable roles, including the transitive grants, in given identitySet<RoleGrant>listRoleGrants(Session session, TrinoPrincipal principal)List roles grants for a given principal, not recursively.Set<String>listRoles(Session session)List available roles.Set<GrantInfo>listTablePrivileges(Session session, QualifiedTablePrefix prefix)Gets the privileges for the specified table available to the given grantee considering the selected session rolevoidrevokeRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor)Revokes the specified roles from the specified grantees.voidrevokeSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Revokes the specified privilege on the specified schema from the specified user.voidrevokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)Revokes the specified privilege on the specified table from the specified userbooleanroleExists(Session session, String role)Does the specified role exist.voidschemaCreated(Session session, CatalogSchemaName schema)A schema was createdvoidschemaDropped(Session session, CatalogSchemaName schema)A schema was droppedvoidschemaRenamed(Session session, CatalogSchemaName sourceSchema, CatalogSchemaName targetSchema)A schema was renamedvoidsetSchemaOwner(Session session, CatalogSchemaName schema, TrinoPrincipal principal)Set the owner of the specified schemavoidsetTableOwner(Session session, CatalogSchemaTableName table, TrinoPrincipal principal)Set the owner of the specified tablevoidsetViewOwner(Session session, CatalogSchemaTableName view, TrinoPrincipal principal)Set the owner of the specified viewvoidtableCreated(Session session, CatalogSchemaTableName table)A table or view was createdvoidtableDropped(Session session, CatalogSchemaTableName table)A table or view was droppedvoidtableRenamed(Session session, CatalogSchemaTableName sourceTable, CatalogSchemaTableName targetTable)A table or view was renamed
-
-
-
Method Detail
-
roleExists
public boolean roleExists(Session session, String role)
Description copied from interface:SystemSecurityMetadataDoes the specified role exist.- Specified by:
roleExistsin interfaceSystemSecurityMetadata
-
createRole
public void createRole(Session session, String role, Optional<TrinoPrincipal> grantor)
Description copied from interface:SystemSecurityMetadataCreates the specified role.- Specified by:
createRolein interfaceSystemSecurityMetadatagrantor- represents the principal specified by WITH ADMIN statement
-
dropRole
public void dropRole(Session session, String role)
Description copied from interface:SystemSecurityMetadataDrops the specified role.- Specified by:
dropRolein interfaceSystemSecurityMetadata
-
listRoles
public Set<String> listRoles(Session session)
Description copied from interface:SystemSecurityMetadataList available roles.- Specified by:
listRolesin interfaceSystemSecurityMetadata
-
listAllRoleGrants
public Set<RoleGrant> listAllRoleGrants(Session session, Optional<Set<String>> roles, Optional<Set<String>> grantees, OptionalLong limit)
Description copied from interface:SystemSecurityMetadataList all role grants, optionally filtered by passed role, grantee, and limit predicates.- Specified by:
listAllRoleGrantsin interfaceSystemSecurityMetadata
-
listRoleGrants
public Set<RoleGrant> listRoleGrants(Session session, TrinoPrincipal principal)
Description copied from interface:SystemSecurityMetadataList roles grants for a given principal, not recursively.- Specified by:
listRoleGrantsin interfaceSystemSecurityMetadata
-
grantRoles
public void grantRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor)
Description copied from interface:SystemSecurityMetadataGrants the specified roles to the specified grantees.- Specified by:
grantRolesin interfaceSystemSecurityMetadatagrantor- represents the principal specified by GRANTED BY statement
-
revokeRoles
public void revokeRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor)
Description copied from interface:SystemSecurityMetadataRevokes the specified roles from the specified grantees.- Specified by:
revokeRolesin interfaceSystemSecurityMetadatagrantor- represents the principal specified by GRANTED BY statement
-
listApplicableRoles
public Set<RoleGrant> listApplicableRoles(Session session, TrinoPrincipal principal)
Description copied from interface:SystemSecurityMetadataList applicable roles, including the transitive grants, for the specified principal- Specified by:
listApplicableRolesin interfaceSystemSecurityMetadata
-
listEnabledRoles
public Set<String> listEnabledRoles(Identity identity)
Description copied from interface:SystemSecurityMetadataList applicable roles, including the transitive grants, in given identity- Specified by:
listEnabledRolesin interfaceSystemSecurityMetadata
-
grantSchemaPrivileges
public void grantSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:SystemSecurityMetadataGrants the specified privilege to the specified user on the specified schema.- Specified by:
grantSchemaPrivilegesin interfaceSystemSecurityMetadata
-
denySchemaPrivileges
public void denySchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee)
Description copied from interface:SystemSecurityMetadataDenys the specified privilege to the specified user on the specified schema.- Specified by:
denySchemaPrivilegesin interfaceSystemSecurityMetadata
-
revokeSchemaPrivileges
public void revokeSchemaPrivileges(Session session, CatalogSchemaName schemaName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:SystemSecurityMetadataRevokes the specified privilege on the specified schema from the specified user.- Specified by:
revokeSchemaPrivilegesin interfaceSystemSecurityMetadata
-
grantTablePrivileges
public void grantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:SystemSecurityMetadataGrants the specified privilege to the specified user on the specified table- Specified by:
grantTablePrivilegesin interfaceSystemSecurityMetadata
-
denyTablePrivileges
public void denyTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee)
Description copied from interface:SystemSecurityMetadataDenys the specified privilege to the specified user on the specified table- Specified by:
denyTablePrivilegesin interfaceSystemSecurityMetadata
-
revokeTablePrivileges
public void revokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption)
Description copied from interface:SystemSecurityMetadataRevokes the specified privilege on the specified table from the specified user- Specified by:
revokeTablePrivilegesin interfaceSystemSecurityMetadata
-
listTablePrivileges
public Set<GrantInfo> listTablePrivileges(Session session, QualifiedTablePrefix prefix)
Description copied from interface:SystemSecurityMetadataGets the privileges for the specified table available to the given grantee considering the selected session role- Specified by:
listTablePrivilegesin interfaceSystemSecurityMetadata
-
getSchemaOwner
public Optional<TrinoPrincipal> getSchemaOwner(Session session, CatalogSchemaName schema)
Description copied from interface:SystemSecurityMetadataSet the owner of the specified schema- Specified by:
getSchemaOwnerin interfaceSystemSecurityMetadata
-
setSchemaOwner
public void setSchemaOwner(Session session, CatalogSchemaName schema, TrinoPrincipal principal)
Description copied from interface:SystemSecurityMetadataSet the owner of the specified schema- Specified by:
setSchemaOwnerin interfaceSystemSecurityMetadata
-
setTableOwner
public void setTableOwner(Session session, CatalogSchemaTableName table, TrinoPrincipal principal)
Description copied from interface:SystemSecurityMetadataSet the owner of the specified table- Specified by:
setTableOwnerin interfaceSystemSecurityMetadata
-
getViewRunAsIdentity
public Optional<Identity> getViewRunAsIdentity(Session session, CatalogSchemaTableName view)
Description copied from interface:SystemSecurityMetadataGet the identity to run the view as- Specified by:
getViewRunAsIdentityin interfaceSystemSecurityMetadata
-
setViewOwner
public void setViewOwner(Session session, CatalogSchemaTableName view, TrinoPrincipal principal)
Description copied from interface:SystemSecurityMetadataSet the owner of the specified view- Specified by:
setViewOwnerin interfaceSystemSecurityMetadata
-
schemaCreated
public void schemaCreated(Session session, CatalogSchemaName schema)
Description copied from interface:SystemSecurityMetadataA schema was created- Specified by:
schemaCreatedin interfaceSystemSecurityMetadata
-
schemaRenamed
public void schemaRenamed(Session session, CatalogSchemaName sourceSchema, CatalogSchemaName targetSchema)
Description copied from interface:SystemSecurityMetadataA schema was renamed- Specified by:
schemaRenamedin interfaceSystemSecurityMetadata
-
schemaDropped
public void schemaDropped(Session session, CatalogSchemaName schema)
Description copied from interface:SystemSecurityMetadataA schema was dropped- Specified by:
schemaDroppedin interfaceSystemSecurityMetadata
-
tableCreated
public void tableCreated(Session session, CatalogSchemaTableName table)
Description copied from interface:SystemSecurityMetadataA table or view was created- Specified by:
tableCreatedin interfaceSystemSecurityMetadata
-
tableRenamed
public void tableRenamed(Session session, CatalogSchemaTableName sourceTable, CatalogSchemaTableName targetTable)
Description copied from interface:SystemSecurityMetadataA table or view was renamed- Specified by:
tableRenamedin interfaceSystemSecurityMetadata
-
tableDropped
public void tableDropped(Session session, CatalogSchemaTableName table)
Description copied from interface:SystemSecurityMetadataA table or view was dropped- Specified by:
tableDroppedin interfaceSystemSecurityMetadata
-
-