php - Yii - Custom access control criteria -


i developing application using yii framework. in situation want create custom filter. example, normal filters like:

    array('allow',  // allow users perform 'index' , 'view' actions             'actions'=>array('view'),             'users'=>array('*'),         ), 

now, in array index users can put admin, @ or *. wanted know if it's possible customize in way not these 3 parameters used. in system, have set of user roles (which have created in database). there's 1 user called role 'general'. can view pages. there's type of user role of 'business_admin' role can allow him access pages 'general' user's pages.

could implemented having:

    array('allow',          'actions'=>'the_admin_actions',          'users'=>'business_admin',      ), 

please help!

that wont work need users either ? * or @ unless have actual username called business_admin defualt yii config has hard coded 'admin' username. can set rbac though , add 'roles' => 'business_admin'

this answer may yii rbac , yii controllers access rules


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -