Package org.opensaml.profile.logic
Class PredicateAccessControl
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
-
- org.opensaml.profile.logic.PredicateAccessControl
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.IdentifiableComponent,net.shibboleth.utilities.java.support.component.IdentifiedComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,net.shibboleth.utilities.java.support.security.AccessControl
public class PredicateAccessControl extends net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent implements net.shibboleth.utilities.java.support.security.AccessControlAccess control implementation based on a predicate over aProfileRequestContext.To bridge the two designs, this adapter populates an
AccessControlContextplaced beneath theProfileRequestContextto carry the operation and resource parameters and allow access to them from thePredicate.- Since:
- 3.3.0
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.private Predicate<ProfileRequestContext>predicateThe predicate to use.
-
Constructor Summary
Constructors Constructor Description PredicateAccessControl(Predicate<ProfileRequestContext> condition)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckAccess(javax.servlet.ServletRequest request, String operation, String resource)private StringgetLogPrefix()Get logging prefix.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
doInitialize, getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
predicate
@Nonnull private final Predicate<ProfileRequestContext> predicate
The predicate to use.
-
-
Constructor Detail
-
PredicateAccessControl
public PredicateAccessControl(@Nonnull @ParameterName(name="condition") Predicate<ProfileRequestContext> condition)Constructor.- Parameters:
condition- the predicate to use
-
-
Method Detail
-
checkAccess
public boolean checkAccess(@Nonnull javax.servlet.ServletRequest request, @Nullable String operation, @Nullable String resource)- Specified by:
checkAccessin interfacenet.shibboleth.utilities.java.support.security.AccessControl
-
getLogPrefix
@Nonnull private String getLogPrefix()
Get logging prefix.- Returns:
- prefix
-
-