2017 © Pedro Peláez
 

cakephp-plugin cakephp-acl-manager

AclManager for CakePHP 2.x

image

houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  • Saturday, March 19, 2016
  • by houseoftech
  • Repository
  • 2 Watchers
  • 1 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 33 Forks
  • 0 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

AclManager for CakePHP 2.x

This plugins allows you to easily manage your permissions in CakePHP 2.x through the Acl module., (*1)

Features

  • Managing permissions for each node
  • Updating Database with missing AROs (Users, Roles, ...)
  • Updating Database with missing ACOs (Controller actions)
  • Revoking all permissions

Requirements

  • CakePHP 2.x

How to install

1. Set up your Acl environment

  • Install SQL tables through Cake Console
  • parentNode() method on your requester models

See: CakePHP: Simple ACL Controlled Application, (*2)

2. Configure Auth in your AppController

It should look something like this:, (*3)

var $components = array('Auth', 'Acl', 'Session');

function beforeFilter() {
    //Configure AuthComponent
    $this->Auth->authorize = array(
        'Controller',
        'Actions' => array('actionPath' => 'controllers')
    );
    $this->Auth->authenticate = array(
        'Form' => array(
            'fields' => array(
                'username' => 'login',
                'password' => 'password'
            )
        )
    );
    $this->Auth->loginAction = array(
        'controller' => 'users',
        'action' => 'login',
        'admin' => false,
        'plugin' => false
    );
    $this->Auth->logoutRedirect = array(
        'controller' => 'users',
        'action' => 'login',
        'admin' => false,
        'plugin' => false
    );
    $this->Auth->loginRedirect = array(
        'controller' => 'products',
        'action' => 'index',
        'admin' => false,
        'plugin' => false
    );
}

function isAuthorized($user) {
    // return false;
    return $this->Auth->loggedIn();
}

3. Download AclManager

Manually

Download the stable branch (https://github.com/houseoftech/cakephp-acl-manager/archive/stable.zip) and paste the content in your app/Plugin/ directory., (*4)

With Composer

  1. Install composer in the app/ folder of your project.
  2. Add "houseoftech/cakephp-acl-manager": "stable" to your require key in your composer.json file. (More about this)
  3. Run php composer.phar install to install the plugin.

Composer documentation, (*5)

4. Configure the plugin

See AclManager/Config/bootstrap.php, (*6)

AclManager.aros : write in there your requester models aliases (the order is important), (*7)

5. Enable the plugin

In app/Config/bootstrap.php, (*8)

CakePlugin::load('AclManager', array('bootstrap' => true));

6. Login with an existing user

The plugin conflicts with $this->Auth->allow(), do not use it. Just make sure that you are logged in., (*9)

7. Access the plugin at /acl_manager/acl

  • Update your AROs and ACOs
  • Set up your permissions (do not forget to enable your own public actions!)

8. Disable the authorizer Controller

Or uncomment return false in AppController::isAuthorized(), (*10)

9. You're done!

Enjoy!, (*11)

Licence

Licensed under the MIT License, (*12)

The Versions

19/03 2016

dev-master

9999999-dev http://github.com/houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires

 

19/03 2016

1.3.2

1.3.2.0 http://github.com/houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires

 

19/03 2016

dev-stable

dev-stable http://github.com/houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires

 

17/03 2016

1.3.1

1.3.1.0 http://github.com/houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires

 

16/03 2016

1.3.0

1.3.0.0 http://github.com/houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires

 

23/03 2015

1.2.6

1.2.6.0 http://github.com/houseoftech/cakephp-acl-manager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires

 

19/03 2015

1.2.5

1.2.5.0 http://github.com/houseoftech/AclManager

AclManager for CakePHP 2.x

  Sources   Download

MIT

The Requires