MyGit

cakephp/acl

Fork: 91 Star: 110 (更新于 2024-12-06 19:10:26)

license: NOASSERTION

Language: PHP .

Plugin for managing ACL in CakePHP applications.

最后发布版本: 0.10.1 ( 2024-04-02 00:59:50)

GitHub网址

CakePHP Acl Plugin

Build Status Coverage Status License

ℹ️ The ACL Plugin is not actively maintained by the CakePHP core team. ℹ️ PR's to fix problems are welcome.

As a modern alternative please check out the Authentication and Authorization plugins.

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

最近版本更新:(数据更新于 2024-10-20 06:46:56)

2024-04-02 00:59:50 0.10.1

2023-09-11 04:05:52 0.10.0

2023-04-24 10:09:43 0.9

2022-08-30 21:55:24 0.8.0

2022-01-20 13:20:40 0.7.1

2020-09-08 17:41:58 0.7.0

2020-01-07 19:47:10 0.6.0

2019-06-14 21:42:50 0.5.2

2019-04-04 02:05:56 0.5.1

2019-04-03 21:56:55 0.5.0

主题(topics):

acl, cakephp, cakephp-plugin, php

cakephp/acl同语言 PHP最近更新仓库

2024-12-13 19:38:03 coollabsio/coolify

2024-12-13 09:22:46 w7corp/easywechat

2024-12-11 20:15:22 symfony/symfony

2024-11-29 16:49:37 symfony/var-dumper

2024-11-20 23:58:25 laravel/framework

2024-11-20 18:39:23 danielmiessler/SecLists