I am developing an application using Yii framework. I am in a situation where I want to create a custom filter. For example, the normal filters are like:
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('view'),
'users'=>array('*'),
),
Now, in the array index for users
you can only put admin
, @
or *
. I wanted to know if it's possible to customize it in a way that not only these 3 parameters are used.
In my system, I have a set of user roles (which I have created in the database). There's one user called whose role is 'general'. He can only view some pages. There's another type of user with the role of 'business_admin' whose role can allow him to access his pages as well as the 'general' user's pages.
Could this be implemented by having:
array('allow',
'actions'=>'the_admin_actions',
'users'=>'business_admin',
),
Please help!