Configuring user authorization
Yii has two methods to authorize users: ACF and RBAC.
The first one, ACF, is used in applications that require a minimal and simple access control. Basically, its behavior is based on five parameters:
allow
: This parameter specifies whether this is an allow or deny rule; possible values areallow
ordeny
actions
: This parameter specifies which actions this rule matches, and they are declared using an array of stringroles
: This parameter specifies which user roles this rule matches; possible values are?
' and@
, which mean respectively guest user and authenticated userips
: This parameter specifies which client IP address this rule matches; the IP address that can contain*
as a wildcardverbs
: This parameter specifies which verb (request method) this rules matches
By default, if no rule matches, access will be denied.
ACF is enabled by overwriting the behaviors()
method of Controller
and populating its access
property with the content of some (or every one)...