kk1
(kk)
July 8, 2009, 7:26am
1
i want to know whether the user is admin i.e having administrator rights
how can i check it by using Yii::app()->user->…
i check user is guest by Yii::app()->user->isGuest();
and make the menu item visible as in blog example application…
can i get list of methods like isGuest() method.
mbi
(mbi)
July 8, 2009, 7:29am
2
hi there,
Yii::app()->user uses the CWebUser class but doesnt store any access control in it beside isGuest(). so you might want to store your access control in database like administrator to certain username since CWebUser can get username out of it.
or you can read more about yii access control using http://www.yiiframew…-access-control
kk1
(kk)
July 8, 2009, 9:29am
5
can somebody tell where is the admin role declared in the blog demo
it is used in access control
will
(Phpwindcn)
July 8, 2009, 3:30pm
6
Quote
can somebody tell where is the admin role declared in the blog demo
it is used in access control
Please check accessRules() function in controller.