Package org.mapfish.print.config.access
Class AndAccessAssertion
java.lang.Object
org.mapfish.print.config.access.AndAccessAssertion
- All Implemented Interfaces:
AccessAssertion,ConfigurationObject
An access assertion that throws fails if any of the encapsulated assertions fail.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertAccess(String resourceDescription, Object protectedResource) Checks that the user can access the resource.copy()Deep copy of this access assertion.booleaninthashCode()org.json.JSONObjectmarshal()Encode the assertion as JSON for later loading.voidsetPredicates(AccessAssertion... predicates) Set all the Predicates/AccessAssertion that have to all pass in order for this assertion to pass.voidunmarshal(org.json.JSONObject encodedAssertion) Load the assertion properties from the JSON data.voidvalidate(List<Throwable> validationErrors, Configuration configuration) validate that the configuration was correct.
-
Constructor Details
-
AndAccessAssertion
public AndAccessAssertion()
-
-
Method Details
-
setPredicates
Set all the Predicates/AccessAssertion that have to all pass in order for this assertion to pass.An exception is thrown if this method is called more than once.
- Parameters:
predicates- the Predicates/AccessAssertion
-
assertAccess
Description copied from interface:AccessAssertionChecks that the user can access the resource.Will throw
AuthenticationCredentialsNotFoundExceptionif the user has not logged in or supplied credentials.Will throw
AccessDeniedExceptionif the user is logged in but may not access the resource.- Specified by:
assertAccessin interfaceAccessAssertion- Parameters:
resourceDescription- a string describing the resource for logging and exception throwing purposesprotectedResource- the resource being protected.
-
marshal
public org.json.JSONObject marshal()Description copied from interface:AccessAssertionEncode the assertion as JSON for later loading. Each call should return a unique JSON object.- Specified by:
marshalin interfaceAccessAssertion
-
unmarshal
public void unmarshal(org.json.JSONObject encodedAssertion) Description copied from interface:AccessAssertionLoad the assertion properties from the JSON data.- Specified by:
unmarshalin interfaceAccessAssertion- Parameters:
encodedAssertion- the assertion encoded as JSON.
-
validate
Description copied from interface:ConfigurationObjectvalidate that the configuration was correct.- Specified by:
validatein interfaceConfigurationObject- Parameters:
validationErrors- a list to add any detected errors to.configuration- the containing configuration
-
equals
-
hashCode
public int hashCode() -
copy
Description copied from interface:AccessAssertionDeep copy of this access assertion.- Specified by:
copyin interfaceAccessAssertion- Returns:
- the copy
-