Package ch.tocco.nice2.security.impl
Class SecurityContextImpl
java.lang.Object
ch.tocco.nice2.security.impl.SecurityContextImpl
- All Implemented Interfaces:
SecurityContext
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.security.api.SecurityContext
SecurityContext.Current
-
Constructor Summary
ConstructorDescriptionSecurityContextImpl
(org.slf4j.Logger log, SecurityManagerImpl manager, Principal principal, Policy policy, List<GuardFactory> guardFactories, @Nullable UUID sessionId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Returns aGuard
for exactly one client.getGuardForList
(List<?> secured) @Nullable UUID
@Nullable Node
prepareCondition
(Node condition)
-
Constructor Details
-
SecurityContextImpl
public SecurityContextImpl(org.slf4j.Logger log, SecurityManagerImpl manager, Principal principal, Policy policy, List<GuardFactory> guardFactories, @Nullable @Nullable UUID sessionId)
-
-
Method Details
-
getPrincipal
- Specified by:
getPrincipal
in interfaceSecurityContext
- Returns:
- The principal, may be anonymous.
-
getSessionId
- Specified by:
getSessionId
in interfaceSecurityContext
-
getGuard
Description copied from interface:SecurityContext
Returns aGuard
for exactly one client.- Specified by:
getGuard
in interfaceSecurityContext
- Parameters:
secured
- For example an Entity or an EntityManager.
-
getGuardForList
- Specified by:
getGuardForList
in interfaceSecurityContext
- Returns:
- A
ListGuard
for efficiently evaluating permissions of multiple objects of the same type.
-
getPolicy
- Specified by:
getPolicy
in interfaceSecurityContext
- Returns:
- the unfiltered policy contained in this SecurityContext
-
prepareCondition
- Specified by:
prepareCondition
in interfaceSecurityContext
- Throws:
EvaluationException
-
destroy
public void destroy()- Specified by:
destroy
in interfaceSecurityContext
-