Interface AccessControlMetadata
- All Known Implementing Classes:
SqlStandardAccessControlMetadata
public interface AccessControlMetadata
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcreateRole(ConnectorSession session, String role, Optional<HivePrincipal> grantor) Creates the specified role.default voiddropRole(ConnectorSession session, String role) Drops the specified role.default Optional<HivePrincipal> getSchemaOwner(ConnectorSession session, String schemaName) Get the owner on the specified schemadefault voidgrantRoles(ConnectorSession connectorSession, Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, Optional<HivePrincipal> grantor) Grants the specified roles to the specified granteesdefault voidgrantSchemaPrivileges(ConnectorSession session, String schemaName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Grants the specified privilege to the specified user on the specified schemadefault voidgrantTablePrivileges(ConnectorSession session, SchemaTableName tableName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Grants the specified privilege to the specified user on the specified tabledefault booleanlistApplicableRoles(ConnectorSession session, HivePrincipal principal) List applicable roles, including the transitive grants, for the specified principallistEnabledRoles(ConnectorSession session) List applicable roles, including the transitive grants, in given sessionlistRoleGrants(ConnectorSession session, HivePrincipal principal) List role grants for a given principal, not recursively.listRoles(ConnectorSession session) List available roles.listTablePrivileges(ConnectorSession session, List<SchemaTableName> tableName) List the table privileges granted to the specified grantee for the tables that have the specified prefix considering the selected session roledefault voidrevokeRoles(ConnectorSession connectorSession, Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, Optional<HivePrincipal> grantor) Revokes the specified roles from the specified granteesdefault voidrevokeSchemaPrivileges(ConnectorSession session, String schemaName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified schema from the specified userdefault voidrevokeTablePrivileges(ConnectorSession session, SchemaTableName tableName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified table from the specified userdefault booleanroleExists(ConnectorSession session, String role) Does the specified role exist.
-
Method Details
-
isUsingSystemSecurity
default boolean isUsingSystemSecurity() -
roleExists
Does the specified role exist. -
createRole
Creates the specified role.- Parameters:
grantor- represents the principal specified by WITH ADMIN statement
-
dropRole
Drops the specified role. -
listRoles
List available roles. -
listRoleGrants
List role grants for a given principal, not recursively. -
grantRoles
default void grantRoles(ConnectorSession connectorSession, Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, Optional<HivePrincipal> grantor) Grants the specified roles to the specified grantees- Parameters:
grantor- represents the principal specified by GRANTED BY statement
-
revokeRoles
default void revokeRoles(ConnectorSession connectorSession, Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, Optional<HivePrincipal> grantor) Revokes the specified roles from the specified grantees- Parameters:
grantor- represents the principal specified by GRANTED BY statement
-
listApplicableRoles
List applicable roles, including the transitive grants, for the specified principal -
listEnabledRoles
List applicable roles, including the transitive grants, in given session -
grantSchemaPrivileges
default void grantSchemaPrivileges(ConnectorSession session, String schemaName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Grants the specified privilege to the specified user on the specified schema -
getSchemaOwner
Get the owner on the specified schema -
revokeSchemaPrivileges
default void revokeSchemaPrivileges(ConnectorSession session, String schemaName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified schema from the specified user -
grantTablePrivileges
default void grantTablePrivileges(ConnectorSession session, SchemaTableName tableName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Grants the specified privilege to the specified user on the specified table -
revokeTablePrivileges
default void revokeTablePrivileges(ConnectorSession session, SchemaTableName tableName, Set<Privilege> privileges, HivePrincipal grantee, boolean grantOption) Revokes the specified privilege on the specified table from the specified user -
listTablePrivileges
default List<GrantInfo> listTablePrivileges(ConnectorSession session, List<SchemaTableName> tableName) List the table privileges granted to the specified grantee for the tables that have the specified prefix considering the selected session role
-