Interface IPersistencePolicy
public interface IPersistencePolicy
Persistence policy class.
- Version:
- $Revision$ $Date$
- Author:
- Stepan Roh, Polarion Software
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanAddElementToKey(IPObject instance, String key) Security check if the current user can add elements to the list value of given key in the instance.booleancanAddElementToKey(String prototypeName, String key, IContextId contextId) Security check if the current user can add elements to list value of given key in instances of given prototype in given context (project).booleancanCreateInstance(IPObject instance) Security check if the current user can create the instance.booleancanCreateInstances(String prototypeName, IContextId contextId) Security check if the current user can create instances of given prototype in given context (project).booleancanDeleteInstance(IPObject instance) Security check if the current user can delete the instance.booleancanDeleteInstances(String prototypeName, IContextId contextId) Security check if the current user can delete instances of given prototype in given context (project).booleancanModifyInstance(IPObject instance) Security check if the current user can modify the instance.booleancanModifyInstances(String prototypeName, IContextId contextId) Security check if the current user can modify instances of given prototype in given context (project).booleancanModifyKey(IPObject instance, String key) Security check if the current user can modify value of given key in the instances.booleancanModifyKey(String prototypeName, String key, IContextId contextId) Security check if the current user can modify value of given key in instances of given prototype in given context (project).booleancanReadInstance(IPObject instance) Security check if the current user can read the instance.booleancanReadInstance(String userId, IPObject instance) Security check if the specified user can read the instance.booleancanReadInstances(String prototypeName, IContextId contextId) Security check if the current user can read instances of given prototype in given context (project).booleancanReadInstances(String userId, String prototypeName, IContextId contextId) Security check if the specified user can read instances of given prototype in given context (project).booleancanReadKey(IPObject instance, String key) Security check if the current user can read value of given key in the instance.booleancanReadKey(String prototypeName, String key, IContextId contextId) Security check if the current user can read value of given key in instances of given prototype in given context (project).booleancanRemoveElementFromKey(IPObject instance, String key) Security check if the current user can remove elements from the list value of given key in instance.booleancanRemoveElementFromKey(String prototypeName, String key, IContextId contextId) Security check if the current user can remove elements from list value of given key in instances of given prototype in given context (project).voidcheckCanAddElementToKey(IPObject instance, String key) Similar tocanAddElementToKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanAddElementToKey(String prototypeName, String key, IContextId contextId) Similar tocanAddElementToKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanCreateInstance(IPObject instance) Similar tocanCreateInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanCreateInstances(String prototypeName, IContextId contextId) Similar tocanCreateInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanDeleteInstance(IPObject instance) Similar tocanDeleteInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanDeleteInstances(String prototypeName, IContextId contextId) Similar tocanDeleteInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanModifyInstance(IPObject instance) Similar tocanModifyInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanModifyInstances(String prototypeName, IContextId contextId) Similar tocanModifyInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanModifyKey(IPObject instance, String key) Similar tocanModifyKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanModifyKey(String prototypeName, String key, IContextId contextId) Similar tocanModifyKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanReadInstance(IPObject instance) Similar tocanReadInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanReadInstances(String prototypeName, IContextId contextId) Similar tocanReadInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanReadKey(IPObject instance, String key) Similar tocanReadKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanReadKey(String prototypeName, String key, IContextId contextId) Similar tocanReadKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanRemoveElementFromKey(IPObject instance, String key) Similar tocanRemoveElementFromKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionvoidcheckCanRemoveElementFromKey(String prototypeName, String key, IContextId contextId) Similar tocanRemoveElementFromKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedExceptionConvenience method.voidpreEvaluateCustomSets(Iterable<IPObject> instances) Internal API, do not use. Pre-evaluates custom sets for first 20 instances from the givenIterable. It is meant for improving performance of evaluating the custom sets permissions. Not persisted instances are ignored. The instances should be sorted by prototype and context for best efficiency.
-
Method Details
-
getSecurityService
Convenience method.- Returns:
- The platform's
ISecurityService.
-
canReadInstances
Security check if the current user can read instances of given prototype in given context (project).- Parameters:
prototypeName-contextId-- Returns:
trueif the current user can read instances of the prototype in the specified context
-
checkCanReadInstances
Similar tocanReadInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canReadInstances
boolean canReadInstances(@Nullable String userId, @Nullable String prototypeName, @Nullable IContextId contextId) Security check if the specified user can read instances of given prototype in given context (project).- Parameters:
prototypeName-contextId-- Returns:
trueif the specified user can read instances of the prototype in the specified context- Since:
- 3.5.0
-
canModifyInstances
Security check if the current user can modify instances of given prototype in given context (project).- Parameters:
prototypeName-contextId-- Returns:
trueif the current user can modify instances of the prototype in the specified context
-
checkCanModifyInstances
Similar tocanModifyInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canCreateInstances
Security check if the current user can create instances of given prototype in given context (project).- Parameters:
prototypeName-contextId-- Returns:
trueif the current user can create instances of the prototype in the specified context
-
checkCanCreateInstances
Similar tocanCreateInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canDeleteInstances
Security check if the current user can delete instances of given prototype in given context (project).- Parameters:
prototypeName-contextId-- Returns:
trueif the current user can read the prototype in the specified context
-
checkCanDeleteInstances
Similar tocanDeleteInstances(String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canReadInstance
Security check if the current user can read the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-- Returns:
trueif the current user can read theinstance
-
checkCanReadInstance
Similar tocanReadInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-- Throws:
PermissionDeniedException- if permission is denied
-
canReadInstance
Security check if the specified user can read the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-- Returns:
trueif the specified user can read theinstance- Since:
- 3.5.0
-
canModifyInstance
Security check if the current user can modify the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-- Returns:
trueif the current user can modify theinstance
-
checkCanModifyInstance
Similar tocanModifyInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-- Throws:
PermissionDeniedException- if permission is denied
-
canCreateInstance
Security check if the current user can create the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-- Returns:
trueif the current user can create theinstance
-
checkCanCreateInstance
Similar tocanCreateInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-- Throws:
PermissionDeniedException- if permission is denied
-
canDeleteInstance
Security check if the current user can delete the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-- Returns:
trueif the current user can delete theinstance
-
checkCanDeleteInstance
Similar tocanDeleteInstance(IPObject), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-- Throws:
PermissionDeniedException- if permission is denied
-
canReadKey
boolean canReadKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Security check if the current user can read value of given key in instances of given prototype in given context (project).- Parameters:
prototypeName-key-contextId-- Returns:
trueif the current user can read the value ofkeyfor the specified prototype in specified context
-
checkCanReadKey
void checkCanReadKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Similar tocanReadKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canModifyKey
boolean canModifyKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Security check if the current user can modify value of given key in instances of given prototype in given context (project).- Parameters:
prototypeName-key-contextId-- Returns:
trueif the current user can modify the value ofkeyfor the specified prototype in specified context
-
checkCanModifyKey
void checkCanModifyKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Similar tocanModifyKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canAddElementToKey
boolean canAddElementToKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Security check if the current user can add elements to list value of given key in instances of given prototype in given context (project).- Parameters:
prototypeName-key-contextId-- Returns:
trueif the current user can add values to the list atkeyfor the specified prototype in specified context
-
checkCanAddElementToKey
void checkCanAddElementToKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Similar tocanAddElementToKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canRemoveElementFromKey
boolean canRemoveElementFromKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Security check if the current user can remove elements from list value of given key in instances of given prototype in given context (project).- Parameters:
prototypeName-key-contextId-- Returns:
trueif the current user can remove values from the list atkeyfor the specified prototype in specified context
-
checkCanRemoveElementFromKey
void checkCanRemoveElementFromKey(@Nullable String prototypeName, @Nullable String key, @Nullable IContextId contextId) Similar tocanRemoveElementFromKey(String,String,IContextId), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
prototypeName-contextId-- Throws:
PermissionDeniedException- if permission is denied
-
canReadKey
Security check if the current user can read value of given key in the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-key-- Returns:
trueif the current user can read the value atkeyfor the specifiedinstance
-
checkCanReadKey
Similar tocanReadKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-key-- Throws:
PermissionDeniedException- if permission is denied
-
canModifyKey
Security check if the current user can modify value of given key in the instances. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-key-- Returns:
trueif the current user can modify the value atkeyfor the specifiedinstance
-
checkCanModifyKey
Similar tocanModifyKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-key-- Throws:
PermissionDeniedException- if permission is denied
-
canAddElementToKey
Security check if the current user can add elements to the list value of given key in the instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-key-- Returns:
trueif the current user can add values to the list atkeyfor the specifiedinstance
-
checkCanAddElementToKey
Similar tocanAddElementToKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-key-- Throws:
PermissionDeniedException- if permission is denied
-
canRemoveElementFromKey
Security check if the current user can remove elements from the list value of given key in instance. This method can only restrict the access more than method with prototypeName and context as parameters.- Parameters:
instance-key-- Returns:
trueif the current user can remove values from the list atkeyfor the specifiedinstance
-
checkCanRemoveElementFromKey
Similar tocanRemoveElementFromKey(IPObject,String), with the difference that instead of returningfalse, it will throw PermissionDeniedException- Parameters:
instance-key-- Throws:
PermissionDeniedException- if permission is denied
-
preEvaluateCustomSets
Internal API, do not use. Pre-evaluates custom sets for first 20 instances from the givenIterable. It is meant for improving performance of evaluating the custom sets permissions. Not persisted instances are ignored. The instances should be sorted by prototype and context for best efficiency.- Since:
- 3.10.1
-