ZMObject
|
+--ZMSacsMapper
public class ZMSacsMapper
extends ZMObject
| Field Summary | |
|---|---|
| final mixed | Access level anonymous. |
| final mixed | Access level by group. |
| final mixed | Access level guest. |
| final mixed | Access level registered. |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| void | ensureAccessMethod(string page) Ensure the page is accessed using proper security. |
| void | ensureAuthorization(string page, mixed user) Authorize the current request. |
| protected mixed | getMappingValue(string page, string key, mixed default) Get mapping value. |
| static void | instance() Get instance. |
| boolean | secureRequired(string page) Check if a request to the given page [name] is required to be secure. |
| void | setMapping(string page, string authentication, boolean secure) Set a mapping. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final mixed ANONYMOUS = 'anonymous'
Access level anonymous. */
public final mixed GROUP = 'group'
Access level by group. */
public final mixed GUEST = 'guest'
Access level guest. */
public final mixed REGISTERED = 'registered'
Access level registered. */
public ZMSacsMapper()
Create new instance. /
public void ensureAccessMethod(string page)
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 void ensureAuthorization(string page, mixed user)
Authorize the current request.
ZMAccount.protected mixed getMappingValue(string page, string key, mixed default)
Get mapping value.
null.public static void instance()
Get instance. /
public boolean secureRequired(string page)
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 page, string authentication, boolean secure)
Set a mapping.
For Ajax requests, the access level may be configured on method level by using the following format
for $page:
[page]#[method]
Example: To limit access to the getProductForId Ajax method of the catalog controller do:
ZMSacsMapper::instance()->setMapping('ajax_catalog#getProductForId', ZMSacsMapper::REGISTERED, false);
ZM_PAGE_KEY].ZMSacsMapper::REGISTERED.true.
Handle access control and security mappings.
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 be enforcer by redirects using SSL (if configured), if non secure HTTP is used to access them.