assign a role

Hello,

I don’t understand how to assign a role…

I want to use for now in learning porpuses the simple




	public function filters()

    {

        return array(

            'accessControl',

        );

    }

    

	public function accessRules()

    {

        return array(

            array('deny',

                'actions'=>array('create', 'edit'),

                'users'=>array('?'),

            ),



etc…

But I can’t find how to assign to the user a role… I want it to be based on what in the databes…

don’t need to much for now, just guest user admin roles


or I forced to use CWebUser ?

Everything can be found in Documentation: http://www.yiiframework.com/doc/guide/1.1/en/topics.auth#role-based-access-control

Pedro84 Sorry, but I read this documentation twice, and I don’t understand the difference between the simple aproach and RBAC

how to assign admin role withought CWebUser, from UserInetity?

is there something like $identity->level or ->role to assign?

Just don’t get it

or in the simple aproach you can use logged in and not logged in, and cant use roles like "admin" etc. ?

up…

check this out http://www.yiiframework.com/wiki/65/how-to-setup-rbac-with-a-php-file/

hope it helps you get started