public class DataRolePolicyDecider extends Object implements PolicyDecider
Constructor and Description |
---|
DataRolePolicyDecider() |
Modifier and Type | Method and Description |
---|---|
Set<AbstractMetadataRecord> |
getInaccessibleResources(DataPolicy.PermissionType action,
Set<AbstractMetadataRecord> resources,
DataPolicy.Context context,
CommandContext commandContext)
Returns the set of resources not allowed to be accessed by the current user.
|
DataPolicy.ResourceType |
getResourceType(AbstractMetadataRecord record) |
boolean |
hasRole(String roleName,
CommandContext context)
Called by the system hasRole function to determine role membership.
|
boolean |
isLanguageAllowed(String language,
CommandContext commandContext)
Returns true if the given language is allowed
|
boolean |
isTempAccessible(DataPolicy.PermissionType action,
AbstractMetadataRecord resource,
DataPolicy.Context context,
CommandContext commandContext)
Checks if the temp table are accessible.
|
void |
setAllowCreateTemporaryTablesByDefault(boolean allowCreateTemporaryTablesByDefault) |
void |
setAllowFunctionCallsByDefault(boolean allowFunctionCallsDefault) |
boolean |
validateCommand(CommandContext commandContext)
Determines if an authorization check should proceed
|
public Set<AbstractMetadataRecord> getInaccessibleResources(DataPolicy.PermissionType action, Set<AbstractMetadataRecord> resources, DataPolicy.Context context, CommandContext commandContext)
PolicyDecider
getInaccessibleResources
in interface PolicyDecider
action
- if context is METADATA, then action execute means a procedure or function, and read some other resourcecontext
- in which the action is performed.
For example you can have a context of DataPolicy.Context.UPDATE
for a DataPolicy.PermissionType.READ
for columns used in an UPDATE condition.public boolean isLanguageAllowed(String language, CommandContext commandContext)
PolicyDecider
isLanguageAllowed
in interface PolicyDecider
public boolean hasRole(String roleName, CommandContext context)
PolicyDecider
hasRole
in interface PolicyDecider
public boolean isTempAccessible(DataPolicy.PermissionType action, AbstractMetadataRecord resource, DataPolicy.Context context, CommandContext commandContext)
PolicyDecider
isTempAccessible
in interface PolicyDecider
resource
- will be null for general temp accesscontext
- in which the action is performed.
For example you can have a context of DataPolicy.Context.UPDATE
for a DataPolicy.PermissionType.READ
for columns used in an UPDATE condition.public void setAllowCreateTemporaryTablesByDefault(boolean allowCreateTemporaryTablesByDefault)
public void setAllowFunctionCallsByDefault(boolean allowFunctionCallsDefault)
public boolean validateCommand(CommandContext commandContext)
PolicyDecider
validateCommand
in interface PolicyDecider
public DataPolicy.ResourceType getResourceType(AbstractMetadataRecord record)
Copyright © 2020. All rights reserved.