1
- # Cake-Casbin
1
+ # Cake-Permission
2
2
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 )
6
8
7
9
Use Casbin in CakePHP Framework, Casbin is a powerful and efficient open-source access control library.
8
10
@@ -11,7 +13,7 @@ Use Casbin in CakePHP Framework, Casbin is a powerful and efficient open-source
11
13
Require this package in the ` composer.json ` of your CakePHP project. This will download the package.
12
14
13
15
```
14
- composer require casbin/cake-adapter
16
+ composer require casbin/cake-permission
15
17
```
16
18
17
19
create config file ` config/casbin.php ` for Casbin:
@@ -32,7 +34,7 @@ return [
32
34
],
33
35
34
36
// Cake-casbin adapter .
35
- 'adapter' => '\CasbinAdapter\ Cake\Adapter',
37
+ 'adapter' => '\Cake\Permission \Adapter',
36
38
37
39
/*
38
40
* Cake-casbin database setting.
@@ -72,7 +74,7 @@ $sub = 'alice'; // the user that wants to access a resource.
72
74
$obj = 'data1'; // the resource that is going to be accessed.
73
75
$act = 'read'; // the operation that the user performs on the resource.
74
76
75
- $casbin = new \CasbinAdapter\ Cake\Casbin();
77
+ $casbin = new \Cake\Permission \Casbin();
76
78
77
79
if (true === $casbin->enforce($sub, $obj, $act)) {
78
80
// permit alice to read data1
0 commit comments