Hi all

I need some help understanding the RBAC implemenation t:)

I have my roles defined in the rbac_definitions.xml file and in my
user database, each user is assigned a role. So user A has role
'employee', user B has role 'manager' etc.

My question is, how do I assign this role to the user object at
login-time. I tried

$this->getContext()->getUser()->grantRole('employee');

but this doesn't work as getUser() returns an instance of
AgaviSecurityUser and not AgaviRbacSecurityUser.

I earlier had the credentials themselves stored in the database and
then added them with addCredential(), like below, which worked
correctly but was obviously not very maintainable.

      $this->getContext()->getUser()->addCredential('book.create');
      $this->getContext()->getUser()->addCredential('book.delete');

Any advice appreciated.

Vikram

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to