Skip to content

1.4 Release

Compare
Choose a tag to compare
@ihorchepurnyi ihorchepurnyi released this 16 Aug 16:38
· 51 commits to master since this release

Date: August, 16, 2016

  1. Added allowActions property to AccessControl filter

Usage:

// When filter attaches globally

'as access' => [
    'class' => yii2mod\rbac\filters\AccessControl::class,
    'allowActions' => [
        'site/*',
        'admin/*',
        // The actions listed here will be allowed to everyone including guests.
        // So, 'admin/*' should not appear here in the production, of course.
        // But in the earlier stages of your development, you may probably want to
        // add a lot of actions here until you finally completed setting up rbac,
        // otherwise you may not even take a first step.
    ]
 ],

// When filter attaches via `behaviors` in the controller

public function behaviors()
{
    return [
        'access' => [
            'class' => AccessControl::className(),
            'allowActions' => ['contact', 'about-us'], // list of controller actions
   ],
}