Package ch.tocco.nice2.security.spi
Class AbstractSecurityDomain
java.lang.Object
ch.tocco.nice2.security.spi.AbstractSecurityDomain
- All Implemented Interfaces:
SecurityDomain
- Direct Known Subclasses:
ActionSecurityDomain
,AdminMenuSecurityDomain
,InfoboxSecurityDomain
,ManagerSecurityDomain
,ReportSecurityDomain
Base class for a simple
SecurityDomain
that is not used very extensively.
These domains do not support evaluating multiple secured objects at once (because each object uses a different
policy). Since they also do not support conditions there is no benefit to evaluate them together anyway.
Policies are currently not cached, because these domains are not used very often.-
Constructor Summary
-
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.void
clearGuardCache
(SecurityContext securityContext) Clear all cached objects belonging to the given security context.getOrCreateFilteredPolicy
(SecurityContext securityContext, List<?> objects, Callable<Policy> provider) Return a policy for the given objects.protected abstract Class<?>[]
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.security.spi.SecurityDomain
evaluateCondition, getSelectorFactory
-
Constructor Details
-
AbstractSecurityDomain
public AbstractSecurityDomain()
-
-
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.- Specified by:
aggregateSupportedObjects
in interfaceSecurityDomain
-
getSupportedClasses
-
getOrCreateFilteredPolicy
public Policy getOrCreateFilteredPolicy(SecurityContext securityContext, List<?> objects, Callable<Policy> provider) throws Exception Description copied from interface:SecurityDomain
Return a policy for the given objects. This can be used to cache and reuse policies for different objects. If no cached policy is available, the givenCallable
can be used to create a new one.- Specified by:
getOrCreateFilteredPolicy
in interfaceSecurityDomain
- Throws:
Exception
-
clearGuardCache
Description copied from interface:SecurityDomain
Clear all cached objects belonging to the given security context.- Specified by:
clearGuardCache
in interfaceSecurityDomain
-