All Projects → cakephp → Acl

cakephp / Acl

Licence: other
Plugin for managing ACL in CakePHP applications.

Projects that are alternatives of or similar to Acl

Cakephp Tinyauth
CakePHP TinyAuth plugin for an easy and fast user authentication and authorization. Single or multi role. DB or config file based.
Stars: ✭ 114 (+0.88%)
Mutual labels:  cakephp, cakephp-plugin, acl
Bootstrap Ui
CakePHP: Transparently use Bootstrap
Stars: ✭ 293 (+159.29%)
Mutual labels:  cakephp, cakephp-plugin
Webservice
Bringing the power of the CakePHP ORM to your favourite webservices
Stars: ✭ 79 (-30.09%)
Mutual labels:  cakephp, cakephp-plugin
Cakepdf
CakePHP plugin for creating and/or rendering PDFs, supporting several popular PDF engines.
Stars: ✭ 360 (+218.58%)
Mutual labels:  cakephp, cakephp-plugin
Footprint
CakePHP plugin to allow passing currently logged in user to model layer.
Stars: ✭ 81 (-28.32%)
Mutual labels:  cakephp, cakephp-plugin
crud-users
CakePHP: Users plugin based on the CRUD action classes
Stars: ✭ 17 (-84.96%)
Mutual labels:  cakephp, cakephp-plugin
Crud
Production-grade rapid controller development with built in love for API and Search
Stars: ✭ 339 (+200%)
Mutual labels:  cakephp, cakephp-plugin
crud-view
CakePHP: Automated admin backend based on your CRUD configuration
Stars: ✭ 45 (-60.18%)
Mutual labels:  cakephp, cakephp-plugin
Users
Users Plugin for CakePHP
Stars: ✭ 488 (+331.86%)
Mutual labels:  cakephp, cakephp-plugin
Debug kit
Debug Toolbar for CakePHP applications.
Stars: ✭ 858 (+659.29%)
Mutual labels:  cakephp, cakephp-plugin
Slug
Slugging for CakePHP
Stars: ✭ 32 (-71.68%)
Mutual labels:  cakephp, cakephp-plugin
Cakephp Hybridauth
CakePHP plugin for HybridAuth
Stars: ✭ 81 (-28.32%)
Mutual labels:  cakephp, cakephp-plugin
queue
A queue-interop compatible Queueing library
Stars: ✭ 25 (-77.88%)
Mutual labels:  cakephp, cakephp-plugin
Enum
Enumeration list for CakePHP 3
Stars: ✭ 27 (-76.11%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-rest
CakePHP REST Plugin - Easily build REST API endpoints in your CakePHP application.
Stars: ✭ 23 (-79.65%)
Mutual labels:  cakephp, cakephp-plugin
Cakephp Tools
A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...
Stars: ✭ 325 (+187.61%)
Mutual labels:  cakephp, cakephp-plugin
Authorization
PSR7 Middleware for authorization
Stars: ✭ 50 (-55.75%)
Mutual labels:  cakephp, cakephp-plugin
cakephp-api-pagination
📑 CakePHP 4 plugin that injects pagination information into API responses.
Stars: ✭ 39 (-65.49%)
Mutual labels:  cakephp, cakephp-plugin
mixerapi
A CakePHP Plugin for RESTful API Development [READ-ONLY]
Stars: ✭ 26 (-76.99%)
Mutual labels:  cakephp, cakephp-plugin
Asset compress
An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.
Stars: ✭ 370 (+227.43%)
Mutual labels:  cakephp, cakephp-plugin

CakePHP Acl Plugin

Build Status Coverage Status License

A plugin for managing ACL in CakePHP applications.

Installing via composer

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require cakephp/acl

Then in your src/Application.php:

public function bootstrap()
{
    parent::bootstrap();
    $this->addPlugin('Acl');
}

Creating tables

To create the ACL requires tables, run the following Migrations command:

bin/cake migrations migrate -p Acl

Attaching the behavior

Add the Acl behavior to your table so it will automatically create an aco whenever a new record is saved:

public function initialize(array $config)
{
    parent::initialize($config);

    $this->addBehavior('Acl.Acl', ['controlled']);
}

Updating the entity

Before you can start using the behavior, you MUST add the parentNode() method to the corresponding Entity file or the AclBehavior will not be able to determine the parent->child relationships. Also make make sure the method returns either null or a parent Model reference.

public function parentNode() {
    return null;
}

If things went well you should now see an entry appearing in the acos database table whenever you save a new record.

Running tests

Assuming you have PHPUnit installed system wide using one of the methods stated here, you can run the tests for the Acl plugin by doing the following:

  1. Copy phpunit.xml.dist to phpunit.xml
  2. Add the relevant database credentials to your phpunit.xml if you want to run tests against a non-SQLite datasource.
  3. Run phpunit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].