ZMObject
└─ZMSacsManager
public class ZMSacsManager
extends ZMObject
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| void | addHandler(ZMSacsHandler handler) Add a ZMSacsHandler. |
| boolean | authorize(ZMRequest request, string requestId, mixed credentials, boolean action, mixed credientials) Authorize the current request. |
| void | ensureAccessMethod(mixed request, string requestId) Ensure the page is accessed using proper security. |
| array | Get the default mapping. |
| mixed | getMappingValue(string requestId, string key, mixed default) Get mapping value. |
| array | Get all mapped requests. |
| boolean | hasMappingForRequestId(string requestId) Check if a mapping for the given requestId exists. |
| 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 | reset() Reset all internal data structures. |
| void | setMapping(string requestId, mixed authentication, boolean secure, array args) Set a mapping. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public void __construct()
Create new instance.
public void addHandler(ZMSacsHandler handler)
Add a ZMSacsHandler.
public boolean authorize(ZMRequest request, string requestId, mixed credentials, boolean action, mixed credientials)
Authorize the current request.
If no configured handler is found, all requests will be authorized.
true.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 array getDefaultMapping()
Get the default mapping.
public mixed getMappingValue(string requestId, string key, mixed default)
Get mapping value.
null.public array getMappings()
Get all mapped requests.
public boolean hasMappingForRequestId(string requestId)
Check if a mapping for the given requestId exists.
true if a mapping exists, false if not.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 reset()
Reset all internal data structures.
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.NOTE: The only required element for each mapping (if done via YAML) is 'level'. It is expected to be boolean and indicates whether the configured resource requires secvu