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
034ba5e6
Commit
034ba5e6
authored
Apr 08, 2014
by
Aleksandr Zelenin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auth guide fix
parent
a75a4415
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 @
034ba5e6
...
...
@@ -130,6 +130,8 @@ use yii\rbac\Rule;
class
NotGuestRule
extends
Rule
{
public
$name
=
'notGuestRule'
;
public
function
execute
(
$params
,
$data
)
{
return
!
Yii
::
$app
->
user
->
isGuest
;
...
...
@@ -152,17 +154,17 @@ return [
],
'items'
=>
[
// HERE ARE YOUR MANAGEMENT TASKS
'manageThing0'
=>
[
'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
],
'manageThing3'
=>
[
'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
],
'manageThing2'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
null
,
'data'
=>
null
],
'manageThing3'
=>
[
'type'
=>
Item
::
TYPE_OPERATION
,
'description'
=>
'...'
,
'ruleName'
=>
null
,
'data'
=>
null
],
// AND THE ROLES
'guest'
=>
[
'type'
=>
Item
::
TYPE_ROLE
,
'description'
=>
'Guest'
,
'ruleName'
=>
NULL
,
'data'
=>
NULL
'ruleName'
=>
null
,
'data'
=>
null
],
'user'
=>
[
...
...
@@ -173,7 +175,7 @@ return [
'manageThing0'
,
// User can edit thing0
],
'ruleName'
=>
$notGuest
->
name
,
'data'
=>
NULL
'data'
=>
null
],
'moderator'
=>
[
...
...
@@ -183,8 +185,8 @@ return [
'user'
,
// Can manage all that user can
'manageThing1'
,
// and also thing1
],
'ruleName'
=>
NULL
,
'data'
=>
NULL
'ruleName'
=>
null
,
'data'
=>
null
],
'admin'
=>
[
...
...
@@ -194,8 +196,8 @@ return [
'moderator'
,
// can do all the stuff that moderator can
'manageThing2'
,
// and also manage thing2
],
'ruleName'
=>
NULL
,
'data'
=>
NULL
'ruleName'
=>
null
,
'data'
=>
null
],
'godmode'
=>
[
...
...
@@ -205,8 +207,8 @@ return [
'admin'
,
// can do all that admin can
'manageThing3'
,
// and also thing3
],
'ruleName'
=>
NULL
,
'data'
=>
NULL
'ruleName'
=>
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