Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b259f991
Commit
b259f991
authored
Nov 25, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added initial steps about configuring DB-based RBAC
parent
13f6a112
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
authorization.md
docs/guide/authorization.md
+22
-0
No files found.
docs/guide/authorization.md
View file @
b259f991
...
...
@@ -76,6 +76,8 @@ Role based access control (RBAC)
Role based access control is very flexible approach to controlling access that is a perfect match for complex systems
where permissions are customizable.
### Using file-based config for RBAC
In order to start using it some extra steps are required. First of all we need to configure
`authManager`
application
component in application config file (
`web.php`
or
`main.php`
depending on template you've used):
...
...
@@ -198,6 +200,26 @@ public function behaviors()
Another way is to call
[
[User::checkAccess()
]
] where appropriate.
### Using DB-based storage for RBAC
Storing RBAC hierarchy in database is less efficient performancewise but is much more flexible. It is easier to create
a good management UI for it so in case you need permissions structure that is managed by end user DB is your choice.
In order to get started you need to configure database connection in
`db`
component. After it is done
[
get
`schema-*.sql`
file for your database](https://github.com/yiisoft/yii2/tree/master/framework/yii/rbac) and execute it.
Next step is to configure
`authManager`
application component in application config file (
`web.php`
or
`main.php`
depending on template you've used):
```
php
'authManager'
=>
[
'class'
=>
'yii\rbac\DbManager'
,
'defaultRoles'
=>
[
'guest'
],
],
```
TBD
### How it works
TBD: write about how it works with pictures :)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment