Hi Vikram, modify user in your factories.xml and set it to AgaviRbacSecurityUser or a class which extends ARSU. Then the functions like grandRole are available via getUser()
In Redracer (http://trac.redracer.org) we use a class RedracerUser which also handles login for instance http://trac.redracer.org/browser/trunk/app/lib/user/RedracerUser.class.php Hope this helps you a little. --- Benjamin Börngen-Schmidt [email protected] Am 22.09.2009 um 18:00 schrieb [email protected]: > 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 _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
