MyGit

cakephp/acl

Fork: 91 Star: 111 (更新于 2024-10-23 01:24:27)

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-11-01 18:37:36 schmittjoh/JMSSerializerBundle

2024-10-31 21:37:53 filamentphp/filament

2024-10-28 00:16:41 symfony/var-dumper

2024-10-28 00:11:41 symfony/symfony

2024-10-11 23:44:26 coollabsio/coolify

2024-10-11 03:27:29 odan/slim4-skeleton