IMO, getRoles() should return all the roles assigned to this object independent of from where and how they are referenced. so user.getRoles() should collect roles from groups/subgroups and this user. I cannot think of a usecase where I only want to see the roles "directly" assigned to the user.

No there different usecases. In one you need to now the exact assigned roles (implementing a user edit dialog for example). Perhaps the security system will use this method to resolve acls (in case you don't use the magnolia one). Otherwise you will always have to read the nodes yourself.

Philipp Bracher






- Sameer


On Jun 13, 2007, at 6:24 PM, Philipp Bracher wrote:

I have another tag that check is user has a role in the list of specified roles...
Based on that I display some edit bars (or not)....

I get a user roles from MgnlContext.getUser().getRoles()...
everything worked great until I realized that instead of assigning 5 roles to each member of the web team I could create a group, assign those 5 roles to a group and then assign team members (users) to group...

But then user.getRoles() returns nothing :)

Am I correct to assume I have to check user groups and then grab roles from each group? If that is the case then ok but shouldn't user.getRoles() already do that? Or is my logic flawed?

I think an additional getAllRoles() or similar should do the job. Feel free to add that feature request to jira.

Philipp Bracher


Regards
Amir







        
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Regards,

Sameer Charles
Magnolia International Ltd.

---------------------------------------------------------------------- -----------
[EMAIL PROTECTED]       http://www.magnolia.info
Magnolia®  - Simple Enterprise Content Management
---------------------------------------------------------------------- -----------







----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to