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
2acf0b31
Commit
2acf0b31
authored
Apr 07, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3021 from zelenin/auth-guide-fix
Authorization auth guide fix
parents
ab9d4d42
034ba5e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
authorization.md
docs/guide/authorization.md
+15
-13
No files found.
docs/guide/authorization.md
View file @
2acf0b31
...
@@ -130,6 +130,8 @@ use yii\rbac\Rule;
...
@@ -130,6 +130,8 @@ use yii\rbac\Rule;
class
NotGuestRule
extends
Rule
class
NotGuestRule
extends
Rule
{
{
public
$name
=
'notGuestRule'
;
public
function
execute
(
$params
,
$data
)
public
function
execute
(
$params
,
$data
)
{
{
return
!
Yii
::
$app
->
user
->
isGuest
;
return
!
Yii
::
$app
->
user
->
isGuest
;
...
@@ -152,17 +154,17 @@ return [
...
@@ -152,17 +154,17 @@ return [
],
],
'items'
=>
[
'items'
=>
[
// HERE ARE YOUR MANAGEMENT TASKS
// HERE ARE YOUR MANAGEMENT TASKS
'manageThing0'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
NULL
,
'data'
=>
NULL
],
'manageThing0'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
null
,
'data'
=>
null
],
'manageThing1'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
NULL
,
'data'
=>
NULL
],
'manageThing1'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
null
,
'data'
=>
null
],
'manageThing2'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
NULL
,
'data'
=>
NULL
],
'manageThing2'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
null
,
'data'
=>
null
],
'manageThing3'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
NULL
,
'data'
=>
NULL
],
'manageThing3'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
null
,
'data'
=>
null
],
// AND THE ROLES
// AND THE ROLES
'guest'
=>
[
'guest'
=>
[
'type'
=>
Item
::
TYPE_ROLE
,
'type'
=>
Item
::
TYPE_ROLE
,
'description'
=>
'Guest'
,
'description'
=>
'Guest'
,
'ruleName'
=>
NULL
,
'ruleName'
=>
null
,
'data'
=>
NULL
'data'
=>
null
],
],
'user'
=>
[
'user'
=>
[
...
@@ -173,7 +175,7 @@ return [
...
@@ -173,7 +175,7 @@ return [
'manageThing0'
,
// User can edit thing0
'manageThing0'
,
// User can edit thing0
],
],
'ruleName'
=>
$notGuest
->
name
,
'ruleName'
=>
$notGuest
->
name
,
'data'
=>
NULL
'data'
=>
null
],
],
'moderator'
=>
[
'moderator'
=>
[
...
@@ -183,8 +185,8 @@ return [
...
@@ -183,8 +185,8 @@ return [
'user'
,
// Can manage all that user can
'user'
,
// Can manage all that user can
'manageThing1'
,
// and also thing1
'manageThing1'
,
// and also thing1
],
],
'ruleName'
=>
NULL
,
'ruleName'
=>
null
,
'data'
=>
NULL
'data'
=>
null
],
],
'admin'
=>
[
'admin'
=>
[
...
@@ -194,8 +196,8 @@ return [
...
@@ -194,8 +196,8 @@ return [
'moderator'
,
// can do all the stuff that moderator can
'moderator'
,
// can do all the stuff that moderator can
'manageThing2'
,
// and also manage thing2
'manageThing2'
,
// and also manage thing2
],
],
'ruleName'
=>
NULL
,
'ruleName'
=>
null
,
'data'
=>
NULL
'data'
=>
null
],
],
'godmode'
=>
[
'godmode'
=>
[
...
@@ -205,8 +207,8 @@ return [
...
@@ -205,8 +207,8 @@ return [
'admin'
,
// can do all that admin can
'admin'
,
// can do all that admin can
'manageThing3'
,
// and also thing3
'manageThing3'
,
// and also thing3
],
],
'ruleName'
=>
NULL
,
'ruleName'
=>
null
,
'data'
=>
NULL
'data'
=>
null
],
],
],
],
];
];
...
...
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