Interface IPersistencePolicy
public interface IPersistencePolicy
Persistence policy class.
- Version:
- $Revision$ $Date$
- Author:
- Stepan Roh, Polarion Software
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAddElementToKey
(IPObject instance, String key) Security check if the current user can add elements to the list value of given key in the instance.boolean
canAddElementToKey
(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).boolean
canCreateInstance
(IPObject instance) Security check if the current user can create the instance.boolean
canCreateInstances
(String prototypeName, IContextId contextId) Security check if the current user can create instances of given prototype in given context (project).boolean
canDeleteInstance
(IPObject instance) Security check if the current user can delete the instance.boolean
canDeleteInstances
(String prototypeName, IContextId contextId) Security check if the current user can delete instances of given prototype in given context (project).boolean
canModifyInstance
(IPObject instance) Security check if the current user can modify the instance.boolean
canModifyInstances
(String prototypeName, IContextId contextId) Security check if the current user can modify instances of given prototype in given context (project).boolean
canModifyKey
(IPObject instance, String key) Security check if the current user can modify value of given key in the instances.boolean
canModifyKey
(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).boolean
canReadInstance
(IPObject instance) Security check if the current user can read the instance.boolean
canReadInstance
(String userId, IPObject instance) Security check if the specified user can read the instance.boolean
canReadInstances
(String prototypeName, IContextId contextId) Security check if the current user can read instances of given prototype in given context (project).boolean
canReadInstances
(String userId, String prototypeName, IContextId contextId) Security check if the specified user can read instances of given prototype in given context (project).boolean
canReadKey
(IPObject instance, String key) Security check if the current user can read value of given key in the instance.boolean
canReadKey
(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).boolean
canRemoveElementFromKey
(IPObject instance, String key) Security check if the current user can remove elements from the list value of given key in instance.boolean
canRemoveElementFromKey
(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).void
checkCanAddElementToKey
(IPObject instance, String key) Similar tocanAddElementToKey(IPObject,String)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanAddElementToKey
(String prototypeName, String key, IContextId contextId) Similar tocanAddElementToKey(String,String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanCreateInstance
(IPObject instance) Similar tocanCreateInstance(IPObject)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanCreateInstances
(String prototypeName, IContextId contextId) Similar tocanCreateInstances(String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanDeleteInstance
(IPObject instance) Similar tocanDeleteInstance(IPObject)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanDeleteInstances
(String prototypeName, IContextId contextId) Similar tocanDeleteInstances(String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanModifyInstance
(IPObject instance) Similar tocanModifyInstance(IPObject)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanModifyInstances
(String prototypeName, IContextId contextId) Similar tocanModifyInstances(String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanModifyKey
(IPObject instance, String key) Similar tocanModifyKey(IPObject,String)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanModifyKey
(String prototypeName, String key, IContextId contextId) Similar tocanModifyKey(String,String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanReadInstance
(IPObject instance) Similar tocanReadInstance(IPObject)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanReadInstances
(String prototypeName, IContextId contextId) Similar tocanReadInstances(String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanReadKey
(IPObject instance, String key) Similar tocanReadKey(IPObject,String)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanReadKey
(String prototypeName, String key, IContextId contextId) Similar tocanReadKey(String,String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanRemoveElementFromKey
(IPObject instance, String key) Similar tocanRemoveElementFromKey(IPObject,String)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionvoid
checkCanRemoveElementFromKey
(String prototypeName, String key, IContextId contextId) Similar tocanRemoveElementFromKey(String,String,IContextId)
, with the difference that instead of returningfalse
, it will throw PermissionDeniedExceptionConvenience method.void
preEvaluateCustomSets
(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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if 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:
true
if the current user can read the value ofkey
for 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:
true
if the current user can modify the value ofkey
for 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:
true
if the current user can add values to the list atkey
for 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:
true
if the current user can remove values from the list atkey
for 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:
true
if the current user can read the value atkey
for 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:
true
if the current user can modify the value atkey
for 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:
true
if the current user can add values to the list atkey
for 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:
true
if the current user can remove values from the list atkey
for 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
-