ZenMagick 0.9.8


org.zenmagick.mvc.ZMSacsManager
\mvc\sacs\ZMSacsManager.php at line 45

Class ZMSacsManager

ZMObject
└─ZMSacsManager

public class ZMSacsManager
extends ZMObject

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 ZMSacsHandler interface.

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.

Author:
DerManoMann
Version:
$Id: ZMSacsManager.php 2723 2009-12-13 22:29:41Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMSacsManager()

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

Constructor Detail

\mvc\sacs\ZMSacsManager.php at line 53

ZMSacsManager

public ZMSacsManager()

Create new instance.


Method Detail

\mvc\sacs\ZMSacsManager.php at line 95

addHandler

public void addHandler(ZMSacsHandler handler)

Add a ZMSacsHandler.

Parameters:
handler - The new handler.

\mvc\sacs\ZMSacsManager.php at line 126

authorize

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.

Parameters:
request - The current request.
requestId - The request id to authorize.
credientials - User information; typically a map with username and password.
Returns:
true if authorization was sucessful.

\mvc\sacs\ZMSacsManager.php at line 156

ensureAccessMethod

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.

Parameters:
requestId - The request id.

\mvc\sacs\ZMSacsManager.php at line 171

getMappingValue

public mixed getMappingValue(string requestId, string key, mixed default)

Get mapping value.

Parameters:
requestId - The request id.
key - The mapping key.
default - The mapping key.
Returns:
The value or the provided default value; default is null.

\mvc\sacs\ZMSacsManager.php at line 74

instance

public static void instance()

Get instance.


\mvc\sacs\ZMSacsManager.php at line 86

load

public void load(string yaml, boolean override)

Load mappings from a YAML style string.

Parameters:
yaml - The yaml style mappings.
override - Optional flag to control whether to override existing mappings or to merge; default is true to override.

\mvc\sacs\ZMSacsManager.php at line 194

requiresSecurity

public boolean requiresSecurity(string requestId)

Check if a request to the given page [name] is required to be secure.

Parameters:
requestId - The request id.
Returns:
true if a secure conenction is required.

\mvc\sacs\ZMSacsManager.php at line 109

setMapping

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.

Parameters:
requestId - The request id [ie. the request name as set via the ZM_PAGE_KEY URL parameter].
authentication - The level of authentication required; default is null.
secure - Mark resource as secure; default is true.
args - Optional additional parameter map; default is an empty array.

ZenMagick 0.9.8