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
32ba5122
Commit
32ba5122
authored
Apr 28, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored AccessControl
parent
185687b0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
AccessControl.php
framework/web/AccessControl.php
+10
-7
No files found.
framework/web/AccessControl.php
View file @
32ba5122
...
...
@@ -33,12 +33,17 @@ class AccessControl extends ActionFilter
*/
public
$denyCallback
;
/**
* @var
string the default class of the access rules. This is used when
*
a rule is configured without specifying a class in [[rules]]
.
* @var
array the default configuration of access rules. Individual rule configurations
*
specified via [[rules]] will take precedence when the same property of the rule is configured
.
*/
public
$defaultRuleClass
=
'yii\web\AccessRule'
;
public
$ruleConfig
=
array
(
'class'
=>
'yii\web\AccessRule'
,
);
/**
* @var array a list of access rule objects or configurations for creating the rule objects.
* @var array a list of access rule objects or configuration arrays for creating the rule objects.
* If a rule is specified via a configuration array, it will be merged with [[ruleConfig]] before
* it is used for creating the rule object.
* @see ruleConfig
*/
public
$rules
=
array
();
...
...
@@ -50,9 +55,7 @@ class AccessControl extends ActionFilter
parent
::
init
();
foreach
(
$this
->
rules
as
$i
=>
$rule
)
{
if
(
is_array
(
$rule
))
{
if
(
!
isset
(
$rule
[
'class'
]))
{
$rule
[
'class'
]
=
$this
->
defaultRuleClass
;
}
$rule
=
array_merge
(
$this
->
ruleConfig
,
$rule
);
$this
->
rules
[
$i
]
=
Yii
::
createObject
(
$rule
);
}
}
...
...
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