Help With Rights Module

Hi. I have problem with Rights module.

When I install module, installer script add to table AuthAssignment user, with username instead of id in column "userid"… And this user is authenticating properly.

Unfortunately when I want to add user through Rights panel, it add user with id (what should be OK) in userid column… And this user is not behaving as it should (he have no access in filtered controllers).

My UserIdentity

class UserIdentity extends CUserIdentity


    private $_id;

    public function authenticate()


        $username = $this->username;

        $user = User::model()->find('username=?', array($username));

        if($user === NULL)


        else if(!$user->validatePassword($this->password, $this->username))



            $this->username = $user->username;

            $this->_id = $user->id;



        return !$this->errorCode;



Please help…