locality / cakephp-authorize
CakePHP plugin including a new authorize class for the Acl component.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
This package is not auto-updated.
Last update: 2020-08-31 07:24:29 UTC
README
This plugin contains a new authorize class for use with the Acl component.
When the ActionsAuthorize maps requests to ACO nodes, it only allows for a maximum length of /:plugin/:controller/:action
. The PathAuthorize class included with this plugin will allow you to use ACO nodes that include the record ID. So the path can now look like /:plugin/:controller/:action/:id
. Allowing you to use the ACL to restrict access to individual records.
Requirements
- PHP 5.2.8
- CakePHP 2.x
Installation
[Git]
In your CakePHP plugin directory, run the following command:
git clone https://github.com/localitysolutions/cakephp-authorize.git Authorize
[Composer]
Add to require
in your composer.json file:
{ "require": { "locality/cakephp-authorize": "dev-master" } }
[Manual]
- Download the zipfile from here: https://github.com/localitysolutions/cakephp-authorize/zipball/master
- Unzip the entire contents.
- Rename the resulting folder to Authorize.
- Finally, copy it to the app/Plugin directory.
Usage
Standard CakePHP plugin installation, in app/Config/bootstrap.php
insert the line: CakePlugin::load('Authorize');
To use the PathAuthorize class for authorization:
//in $components public $components = array( 'Auth' => array( 'authorize' => array( 'Authorize.Path' => array('actionPath' => 'controllers') ) ) ); //Or in beforeFilter() $this->Auth->authorize = array( 'Authorize.Path' => array('actionPath' => 'controllers') );