Skip to content

CakePHP Plugin: an alternative to ACL and log of CRUD operations;

License

Notifications You must be signed in to change notification settings

marcelobns/access_kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakePHP AccessKit

CakePHP Plugin: an alternative to ACL and log of CRUD operations;

##Installation In your app directory type:

git submodule add git://github.com/marcelobns/access_kit.git Plugin/AccessKit
git submodule init
git submodule update

or in your plugin directory type:

git clone git://github.com/marcelobns/access_kit.git AccessKit

Enable plugin

In 2.x you need to enable the plugin at app/Config/bootstrap.php file, using CakePlugin::loadAll(); or CakePlugin::loadAll('AccessKit');

for create tables of plugin use the file Config/Schema/db.sql or type in app

	$ Console/cake schema create --plugin AccessKit Db

in AppController:

class AppController extends Controller {
	public $components = array(
		'Auth' => array(            
            'authorize' => array('Controller'),            
        ),
		'AccessKit.Control'
	);

	public function isAuthorized($user) {              
        return $this->Control->authorize(
          $user['Rule'],
          $this->name,
          $this->action);
    }
}

in Model:

class Role extends AppModel {
	public $actsAs = array('AccessKit.Requester');

}

class User extends AppModel {
	public $actsAs = array(
		'AccessKit.Requester'=>array(
			'Group'=>'Role',
			'GroupKey'=>'role_id'
			)
		);
}

##feel free to contribute

About

CakePHP Plugin: an alternative to ACL and log of CRUD operations;

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages