public function filters() { return array( ‘accessControl‘, // per ‘postOnly + delete‘, // ); } public function accessRules() { return array( array(‘allow‘, // allow all users to pe ‘actions‘=>array(‘index‘,‘view‘), ‘users‘=>array(‘*‘), ), array(‘allow‘, // allow authenticated us ‘actions‘=>array(‘create‘,‘update‘), ‘users‘=>array(‘@‘), ), array(‘allow‘, // allow admin user to pe ‘actions‘=>array(‘admin‘,‘delete‘), ‘users‘=>array(‘admin‘), ), array(‘deny‘, // deny all users ‘users‘=>array(‘*‘), ), ); }
(yii学习笔记)控制器权限控制
时间: 2024-11-06 08:14:43