funayaki / acl-manager
This CakePHP plugin is an interface to manage an ACL protected web application.
Installs: 3
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 1
Type:cakephp-plugin
Requires
- php: >=5.6
- cakephp/acl: ^0.2.6
- cakephp/cakephp: ^3.5.0
- oldskool/cakephp-js: dev-master
Requires (Dev)
- cakephp/cakephp-codesniffer: ^3.0
- phpunit/phpunit: ^5.7|^6.0
This package is not auto-updated.
Last update: 2024-11-01 20:41:19 UTC
README
Version: 2.3.0 Date: 2013-05-02 Author: Nicolas Rod nico@alaxos.com Website: http://www.alaxos.net/blaxos/pages/view/plugin_acl_2.0 License: http://www.opensource.org/licenses/mit-license.php The MIT License
Requirements
- CakePHP 3.x
- Acl (see https://github.com/cakephp/acl)
- CakeJs (see https://github.com/oldskool/cakephp-js)
Installation
Install acl and cakephp-js
At first, you need to install acl
and cakephp-jp
plugins using composer.
The recommended way to install composer packages is:
composer require cakephp/acl composer require oldskool/cakephp-js:dev-master
Enable acl plugin
In 3.0 you need to enable the plugin your config/bootstrap.php
file:
Plugin::load('Acl', ['bootstrap' => true]);
Install acl-manager
[Manual]
- Download and unzip the repo (see the download button somewhere on this git page)
- Copy the resulting folder into
plugins
- Rename the folder you just copied to
AclManager
[GIT Submodule]
In your app
directory type:
git submodule add -b master git://github.com/tsmsogn/acl-manager.git plugins/AclManager git submodule init git submodule update
[GIT Clone]
In your plugins
directory type:
git clone -b master git://github.com/tsmsogn/acl-manager.git AclManager
Enable plugin
In 3.0 you need to enable the plugin your config/bootstrap.php
file:
Plugin::load('AclManager', ['bootstrap' => true, 'routes' => true, 'autoload' => true]);
Acting as a requester
Add $this->addBehavior('Acl.Acl', ['type' => 'requester']);
to the initialize function in the files src/Model/Table/RolesTable.php
and src/Model/Table/UsersTable.php
:
public function initialize(array $config) { parent::initialize($config); $this->addBehavior('Acl.Acl', ['type' => 'requester']); }
Implement parentNode function in Role entity
Add the following implementation of parentNode to the file src/Model/Entity/Role.php:
public function parentNode() { return null; }
Implement parentNode function in User entity
Add the following implementation of parentNode to the file src/Model/Entity/User.php:
public function parentNode() { if (!$this->id) { return null; } if (isset($this->role_id)) { $roleId = $this->role_id; } else { $Users = TableRegistry::get('Users'); $user = $Users->find('all', ['fields' => ['role_id']])->where(['id' => $this->id])->first(); $roleId = $user->role_id; } if (!$roleId) { return null; } return ['Roles' => ['id' => $roleId]]; }
Visit acl-manager using browser
Visit /admin/acl_manager/acos/index
using browser, you will see anything.