ZMObject
└─ZMSacsManager
public class ZMSacsManager
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| void | addHandler(ZMSacsHandler handler) Add a ZMSacsHandler. |
| boolean | authorize(ZMRequest request, string requestId, mixed credentials, mixed credientials) Authorize the current request. |
| void | ensureAccessMethod(mixed request, string requestId) Ensure the page is accessed using proper security. |
| mixed | getMappingValue(string requestId, string key, mixed default) Get mapping value. |
| static void | instance() Get instance. |
| void | load(string yaml, boolean override) Load mappings from a YAML style string. |
| boolean | requiresSecurity(string requestId) Check if a request to the given page [name] is required to be secure. |
| void | setMapping(string requestId, mixed authentication, boolean secure, array args) Set a mapping. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMSacsManager()
Create new instance.
public void addHandler(ZMSacsHandler handler)
Add a ZMSacsHandler.
public boolean authorize(ZMRequest request, string requestId, mixed credentials, mixed credientials)
Authorize the current request.
If no configured handler is found, all requests will be authorized.
true if authorization was sucessful.public void ensureAccessMethod(mixed request, string requestId)
Ensure the page is accessed using proper security.
If a page is requested using HTTP and the page is mapped as secure, a redirect using SSL will be performed.
public mixed getMappingValue(string requestId, string key, mixed default)
Get mapping value.
null.public static void instance()
Get instance.
public void load(string yaml, boolean override)
Load mappings from a YAML style string.
true to override.public boolean requiresSecurity(string requestId)
Check if a request to the given page [name] is required to be secure.
true if a secure conenction is required.public void setMapping(string requestId, mixed authentication, boolean secure, array args)
Set a mapping.
The authentication value depends on the acutal handler implementation and is passed through as-is.
ZM_PAGE_KEY URL parameter].null.true.
Handle access control and security mappings.
This manager class provides abstract access to access control methods. The actual processing is delegated to implementations of the
ZMSacsHandlerinterface.Access control mappings define the level of authentication required for resources. Resources in this context are controller or page requests.
Controller/resources marked as secure will result in redirects using SSL (if configured), if non secure HTTP is used to access them.
Default handler (class names) may be set as a comma separated list with the setting zenmagick.mvc.sacs.handler.
To add handler dynamically the preferred way is to use
addHandler()as the default handler list is only evaluated when the manager instance is created.