Package org.mapfish.print.config.access
Interface AccessAssertion
- All Superinterfaces:
ConfigurationObject
- All Known Implementing Classes:
AlwaysAllowAssertion
,AndAccessAssertion
,RoleAccessAssertion
An access assertion is a check that the current user has particular access/properties to allow
access to a particular resource like a template or completed report.
All implementations must be serializable.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assertAccess
(String resourceDescription, Object protectedResource) Checks that the user can access the resource.copy()
Deep copy of this access assertion.org.json.JSONObject
marshal()
Encode the assertion as JSON for later loading.void
unmarshal
(org.json.JSONObject encodedAssertion) Load the assertion properties from the JSON data.Methods inherited from interface org.mapfish.print.config.ConfigurationObject
validate
-
Method Details
-
assertAccess
Checks that the user can access the resource.Will throw
AuthenticationCredentialsNotFoundException
if the user has not logged in or supplied credentials.Will throw
AccessDeniedException
if the user is logged in but may not access the resource.- Parameters:
resourceDescription
- a string describing the resource for logging and exception throwing purposesprotectedResource
- the resource being protected.
-
marshal
org.json.JSONObject marshal()Encode the assertion as JSON for later loading. Each call should return a unique JSON object. -
unmarshal
void unmarshal(org.json.JSONObject encodedAssertion) Load the assertion properties from the JSON data.- Parameters:
encodedAssertion
- the assertion encoded as JSON.
-
copy
AccessAssertion copy()Deep copy of this access assertion.- Returns:
- the copy
-