Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ganesh sahu
User roles
February 9, 2013 8:19 AM
Answer

ganesh sahu

Rank: New Member

Posts: 3

Join Date: February 9, 2013

Recent Posts

hi , all we have a requirement from the client that a particular user should be able to switch roles in a particular session and that selected role will be the only role which will be used for various user actions. Case : Suppose a user having multiple roles poweruser, administrator ,content writer etc the page has certain tabs which will be visible to user with admin role . How can i restrict the user to use only one role that is admin without removing poweruser and content writer as i would need those roles later for the user to perform other actions. Any suggestions ??
Jelmer Kuperus
RE: User roles
February 9, 2013 8:55 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

Any suggestions ?


get new requirements :-) You will be in a world of pain if you try to go this route.

Also the admin role has all the permissions that poweruser / contentwriter etc have
David H Nebinger
RE: User roles
February 10, 2013 9:21 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11511

Join Date: September 1, 2006

Recent Posts

I agree w/ Jelmer...

Basically roles are containers for privileges, and roles (privileges) are cumulative for a user.

We typically create custom roles and assign those roles to users. Then in the portlets, if users have the roles they will see the additional content/tabs/whatever. This way you can have a user which may have a CUSTOM_USER role that only sees the user content, perhaps a CUSTOM_POWER_USER role that gets visibility on some extra stuff, and a CUSTOM_ADMIN role that can see everything. You selectively grant your custom roles to users and they'll only see what their role(s) give them access to.

As a rule we try not to muck around with or use Liferay roles. These roles control what access a user may have to the portal, but they do not typically map to roles within the organization (i.e. we may give a manager a Power User role, but their specific manager-based roles give them access to manager functionality).
Hitoshi Ozawa
RE: User roles
February 10, 2013 6:22 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Admin has all the privileges to conduct all tasks in the portal. If you want to separate them for auditing reasons, I think you mean that you want to impersonate users with only those roles.

Impersonate User: Opens another browser window which allows you to browse the site as though you were the user.


http://www.liferay.com/documentation/liferay-portal/6.0/administration/-/ai/using-the-control-pan-4
ganesh sahu
RE: User roles
February 11, 2013 1:07 AM
Answer

ganesh sahu

Rank: New Member

Posts: 3

Join Date: February 9, 2013

Recent Posts

My Fault, I should have given a better example. Liferay roles will not be touched. This is a requirement only for custom roles.

Let me try the use case again: We are working on a Claims System. The system has multiple custom roles like coordinator, surveyor, claim processor, assessment analyst etc. A user of this system can have multiple roles (custom roles). The need is that for a session the user should be able to select a particular role as a primary role and the application should then show only what the primary role can see. The user should also be given a facility to change the primary role in the middle of that session and the application from then on should show what the new primary role can see.

Is this even possible with Liferay?