Class EntityPathSecurityDomain
java.lang.Object
ch.tocco.nice2.persist.security.impl.provider.GuardCachingSecurityDomain<Tuple2<EntityModel,String>>
ch.tocco.nice2.persist.security.impl.provider.AbstractEntitySecurityDomain<EntityPath,Tuple2<EntityModel,String>>
ch.tocco.nice2.persist.security.impl.provider.EntityPathSecurityDomain
- All Implemented Interfaces:
SecurityDomain
@Component
public class EntityPathSecurityDomain
extends AbstractEntitySecurityDomain<EntityPath,Tuple2<EntityModel,String>>
Security domain which guards access to entity fields and relations (
EntityPath
objects)-
Field Summary
Fields inherited from class ch.tocco.nice2.persist.security.impl.provider.AbstractEntitySecurityDomain
permissionEvaluator, queryCompiler, securityManager
Fields inherited from class ch.tocco.nice2.persist.security.impl.provider.GuardCachingSecurityDomain
context
-
Constructor Summary
ConstructorDescriptionEntityPathSecurityDomain
(SecurityManager securityManager, QueryCompiler queryCompiler, Context context, PermissionEvaluator permissionEvaluator) -
Method Summary
Modifier and TypeMethodDescriptionaggregateSupportedObjects
(List<?> securedObjects) This method should group all secured objects, which can be evaluated together in aListGuard
, and return a list of these groups.protected com.google.common.cache.Cache
<Tuple2<EntityModel, String>, Policy> protected Tuple2
<EntityModel, String> createCacheKey
(List<?> list) Guards can be shared between allEntityPath
objects with the sameEntityModel
and pathprotected List
<EntityReference> getEntityReferences
(List<EntityPath> secured) Create a selector factory.Methods inherited from class ch.tocco.nice2.persist.security.impl.provider.AbstractEntitySecurityDomain
evaluateCondition
Methods inherited from class ch.tocco.nice2.persist.security.impl.provider.GuardCachingSecurityDomain
clearGuardCache, getOrCreateFilteredPolicy
-
Constructor Details
-
EntityPathSecurityDomain
public EntityPathSecurityDomain(SecurityManager securityManager, QueryCompiler queryCompiler, Context context, PermissionEvaluator permissionEvaluator)
-
-
Method Details
-
aggregateSupportedObjects
Description copied from interface:SecurityDomain
This method should group all secured objects, which can be evaluated together in aListGuard
, and return a list of these groups. This means all objects in a sub-list must require the same policy, (every object in the list would select the same rules of a policy, seeSecurityDomain.getSelectorFactory()
). Secured objects that are not supported by this domain at all should not be returned from this method. If none of the objects are supported, an empty list should be returned. -
getSelectorFactory
Description copied from interface:SecurityDomain
Create a selector factory. A selector factory is an object which creates selectors. There is no interface as the arguments defined in the policy will be matched to factory methods using reflection. The contract for the object returned by this method is as follows:It specify several methods called
createSelector
with the return typeSelector
. It may take any number of arguments. Supported argument types are all Java primitives, String, enumerations and arrays of enumerations. The last argument may be an array, which indicates varargs. Wildcards will be passed asnull
. The methods may throw anInvalidArgumentException
.- Returns:
- The selector factory.
-
getEntityReferences
- Specified by:
getEntityReferences
in classAbstractEntitySecurityDomain<EntityPath,
Tuple2<EntityModel, String>>
-
createCacheKey
Guards can be shared between allEntityPath
objects with the sameEntityModel
and path- Specified by:
createCacheKey
in classGuardCachingSecurityDomain<Tuple2<EntityModel,
String>>
-
buildCache
- Specified by:
buildCache
in classGuardCachingSecurityDomain<Tuple2<EntityModel,
String>>
-