1- # Cake-Casbin
1+ # Cake-Permission
22
3- [ ![ Latest Stable Version] ( https://poser.pugx.org/casbin/cake-adapter/v/stable )] ( https://packagist.org/packages/casbin/cake-adapter )
4- [ ![ Total Downloads] ( https://poser.pugx.org/casbin/cake-adapter/downloads )] ( https://packagist.org/packages/casbin/cake-adapter )
5- [ ![ License] ( https://poser.pugx.org/casbin/cake-adapter/license )] ( https://packagist.org/packages/casbin/cake-adapter )
3+ [ ![ Test] ( https://github.com/php-casbin/cake-permission/workflows/build/badge.svg?branch=master )] ( https://github.com/php-casbin/cake-permission/actions )
4+ [ ![ Coverage Status] ( https://coveralls.io/repos/github/php-casbin/cake-permission/badge.svg )] ( https://coveralls.io/github/php-casbin/cake-permission )
5+ [ ![ Latest Stable Version] ( https://poser.pugx.org/casbin/cake-adapter/v/stable )] ( https://packagist.org/packages/casbin/cake-permission )
6+ [ ![ Total Downloads] ( https://poser.pugx.org/casbin/cake-adapter/downloads )] ( https://packagist.org/packages/casbin/cake-permission )
7+ [ ![ License] ( https://poser.pugx.org/casbin/cake-adapter/license )] ( https://packagist.org/packages/casbin/cake-permission )
68
79Use Casbin in CakePHP Framework, Casbin is a powerful and efficient open-source access control library.
810
@@ -11,7 +13,7 @@ Use Casbin in CakePHP Framework, Casbin is a powerful and efficient open-source
1113Require this package in the ` composer.json ` of your CakePHP project. This will download the package.
1214
1315```
14- composer require casbin/cake-adapter
16+ composer require casbin/cake-permission
1517```
1618
1719create config file ` config/casbin.php ` for Casbin:
@@ -32,7 +34,7 @@ return [
3234 ],
3335
3436 // Cake-casbin adapter .
35- 'adapter' => '\CasbinAdapter\ Cake\Adapter',
37+ 'adapter' => '\Cake\Permission \Adapter',
3638
3739 /*
3840 * Cake-casbin database setting.
@@ -72,7 +74,7 @@ $sub = 'alice'; // the user that wants to access a resource.
7274$obj = 'data1'; // the resource that is going to be accessed.
7375$act = 'read'; // the operation that the user performs on the resource.
7476
75- $casbin = new \CasbinAdapter\ Cake\Casbin();
77+ $casbin = new \Cake\Permission \Casbin();
7678
7779if (true === $casbin->enforce($sub, $obj, $act)) {
7880 // permit alice to read data1
0 commit comments