BackendController::accessRules PHP 메소드

accessRules() 공개 메소드

public accessRules ( ) : array
리턴 array
    public function accessRules()
    {
        return [['allow', 'roles' => ['admin']], ['allow', 'actions' => ['index']], ['allow', 'actions' => ['error']], ['allow', 'actions' => ['AjaxFileUpload']], ['allow', 'actions' => ['AjaxImageUpload']], ['allow', 'actions' => ['transliterate']], ['deny']];
    }

Usage Example

 /**
  * Rules for CAccessControlFilter.
  *
  * We enable the registration and other basic pages for guest users.
  *
  * @see http://www.yiiframework.com/doc/api/1.1/CController#accessRules-detail
  *
  * @return array Rules for the "accessControl" filter.
  */
 public function accessRules()
 {
     return array_merge([['allow', 'actions' => ['index', 'login', 'logout', 'captcha', 'error']]], parent::accessRules());
 }