Skip to content

Commit

Permalink
Update code to last fw changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
vova07 committed Jul 11, 2014
1 parent 921c78f commit 11dc36e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 38 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -34,7 +34,9 @@ Edit `authManager` component in your application config file:
'admin',
'superadmin'
],
'authFile' => '@vova07/rbac/data/rbac.php'
'itemFile' => '@vova07/rbac/data/items.php',
'assignmentFile' => '@vova07/rbac/data/assignments.php',
'ruleFile' => '@vova07/rbac/data/rules.php',
]
```

Expand All @@ -54,4 +56,6 @@ Info

By default `RBAC` module provide 3 defaults roles: `user`, `admin` and `superadmin`.

You can add more roles by creating your own `rbac.php` file.
You can add more roles by creating your own `rules.php` file.

If you want to regenerate the `rbac` files, you can change the `itemFile`, `assignmentFile` and `ruleFile` in your config `authManager` section and run `php yii cron/cron/init`.
2 changes: 2 additions & 0 deletions data/assignments.php
@@ -0,0 +1,2 @@
<?php
return [];
24 changes: 24 additions & 0 deletions data/items.php
@@ -0,0 +1,24 @@
<?php
return [
'user' => [
'type' => 1,
'description' => 'User',
'ruleName' => 'group',
],
'admin' => [
'type' => 1,
'description' => 'Admin',
'ruleName' => 'group',
'children' => [
'user',
],
],
'superadmin' => [
'type' => 1,
'description' => 'Superadmin',
'ruleName' => 'group',
'children' => [
'admin',
],
],
];
36 changes: 0 additions & 36 deletions data/rbac.php

This file was deleted.

4 changes: 4 additions & 0 deletions data/rules.php
@@ -0,0 +1,4 @@
<?php
return [
'group' => 'O:27:"vova07\\rbac\\rules\\GroupRule":3:{s:4:"name";s:5:"group";s:9:"createdAt";N;s:9:"updatedAt";N;}',
];

0 comments on commit 11dc36e

Please sign in to comment.