Package ch.tocco.nice2.security.impl
Class SecurityManagerImpl
java.lang.Object
ch.tocco.nice2.security.impl.SecurityManagerImpl
- All Implemented Interfaces:
- SecurityManager
- 
Constructor SummaryConstructorsConstructorDescriptionSecurityManagerImpl(org.slf4j.Logger log, PolicyCompiler policyCompiler, ContributionManager contributionManager, PrincipalManager principalManager, Authenticator authenticator, ThreadHandlerManager threadHandlerManager, TypeManager typeManager, org.springframework.context.ApplicationEventPublisher eventPublisher) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidvoidbooleanvoidlogout(SecurityContext securityContext) Called to clean up resources when aSecurityContextis destroyedprocessPolicy(Object target, Policy policy, Phase phase, Predicate<Rule> filter, boolean disableProcessors) readPermission(String domainName, String expression) voidsecured()voidsetGuardFactories(List<GuardFactory> guardFactories) voidsetPolicyProcessors(List<PolicyProcessorContribution> processors) voidsetPolicyProviders(List<PolicyProvider> providers) voidsetPolicyValidators(List<PolicyValidator> policyValidators) withAdditionalRules(Consumer<PolicyBuilder> consumer) Note: This method sets a newSecurityContextinto theExecutionContext.withRules(Consumer<PolicyBuilder> consumer) Note: This method sets a newSecurityContextinto theExecutionContext.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.security.api.SecurityManagerlogin, login, processPolicy
- 
Constructor Details- 
SecurityManagerImplpublic SecurityManagerImpl(org.slf4j.Logger log, @Lazy PolicyCompiler policyCompiler, @Lazy ContributionManager contributionManager, @Lazy PrincipalManager principalManager, @Lazy Authenticator authenticator, ThreadHandlerManager threadHandlerManager, TypeManager typeManager, org.springframework.context.ApplicationEventPublisher eventPublisher) 
 
- 
- 
Method Details- 
setPolicyProviders
- 
setPolicyValidators
- 
setPolicyProcessors
- 
setGuardFactories
- 
initializeService@PostConstruct public void initializeService()
- 
getPolicy- Specified by:
- getPolicyin interface- SecurityManager
 
- 
reloadPolicypublic void reloadPolicy()- Specified by:
- reloadPolicyin interface- SecurityManager
 
- 
getAnonymousContext- Specified by:
- getAnonymousContextin interface- SecurityManager
 
- 
anonymous- Specified by:
- anonymousin interface- SecurityManager
- Returns:
- Invoker that runs with an anonymous principal
- See Also:
 
- 
withLogin- Specified by:
- withLoginin interface- SecurityManager
- Returns:
- Invoker that runs with the passed principal
 
- 
withLogin- Specified by:
- withLoginin interface- SecurityManager
- Returns:
- Invoker that runs with the principal of the passed username and password
 
- 
withLogin- Specified by:
- withLoginin interface- SecurityManager
- Parameters:
- ignoreCaptchaVerification- if true, ReCaptcha validation is skipped during login
- Returns:
- Invoker that runs with the principal of the passed username and password
 
- 
loginpublic SecurityContext login(Principal principal, @Nullable @Nullable UUID sessionId, boolean disablePolicyProcessors) throws SecurityException - Specified by:
- loginin interface- SecurityManager
- Throws:
- SecurityException
 
- 
logoutDescription copied from interface:SecurityManagerCalled to clean up resources when aSecurityContextis destroyed- Specified by:
- logoutin interface- SecurityManager
 
- 
processPolicypublic Policy processPolicy(Object target, Policy policy, Phase phase, Predicate<Rule> filter, boolean disableProcessors) - Specified by:
- processPolicyin interface- SecurityManager
 
- 
enterPrivileged- Specified by:
- enterPrivilegedin interface- SecurityManager
- Throws:
- SecurityException
 
- 
exitPrivileged- Specified by:
- exitPrivilegedin interface- SecurityManager
- Throws:
- SecurityException
 
- 
privileged- Specified by:
- privilegedin interface- SecurityManager
- Returns:
- Invoker that runs in privileged mode
 
- 
secured- Specified by:
- securedin interface- SecurityManager
- Returns:
- Invoker that runs in secured mode (i.e. privileged mode is not active)
 
- 
isPrivilegedpublic boolean isPrivileged()- Specified by:
- isPrivilegedin interface- SecurityManager
 
- 
readPermissionpublic Permission readPermission(String domainName, String expression) throws InvalidPermissionException - Specified by:
- readPermissionin interface- SecurityManager
- Throws:
- InvalidPermissionException
 
- 
getAllDomains
- 
withRulesDescription copied from interface:SecurityManagerNote: This method sets a newSecurityContextinto theExecutionContext. To get the enhanced policy, it needs to be fetched again from theExecutionContext.- Specified by:
- withRulesin interface- SecurityManager
- Returns:
- an invoker that runs with the given rules
 
- 
withAdditionalRulesDescription copied from interface:SecurityManagerNote: This method sets a newSecurityContextinto theExecutionContext. To get the enhanced policy, it needs to be fetched again from theExecutionContext.- Specified by:
- withAdditionalRulesin interface- SecurityManager
- Returns:
- an invoker that runs with an enhanced policy which contains the additional given rules
 
 
-