narkomanC
(Narkomanc)
1
Hi!
problem is i dont know how to tell Yii to understand in AdminController that i want to check roles for Yii::app()->admin
, not user
I have two CWebUsers defined in config/main.php
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
'loginUrl'=>array('site/index'),
),
'admin'=>array( // Webuser for the admin area (admin)
'class'=>'CWebUser',
'allowAutoLogin'=>false,
'loginUrl'=>array('admin/login'),
'stateKeyPrefix'=>'admin_',
),
And if i use
'roles'=>array('createPost')
i think yii trying to search in Yii::app()->user permissions.
joblo
(Joe)
2
Take a look at Authentication / Authorization.
You need to an authorization manager for using ‘roles’.
narkomanC
(Narkomanc)
3
I have all set-up and if i would use role sin UserController, it would work.
Only problem is that i have
-
two separated tables user, admin
-
two separated controllers UserController, AdminController
and if i use roles, this would trigger Yii::app()->user permission checking (not Yii::app()->admin).
If i misunderstood your solution, please give me one more hint 
joblo
(Joe)
4
Sorry I forgot the link - see rbac: topics.auth
I don’t know what you mean by
'roles'=>array('createPost')