Question

So I have a Liferay (6.2) portal setup on my WebLogic 12c server, running just fine.

I've created a navigation bar that I want to display differently, depending on a user's organization.

In the portlet_normal.vm where I have created my navigation bar, it should simple to check the user's organization, using a velocity check such as :

#if($user.organization.name == "Organization_1")
    /** display the navigation item **/
#end

However, I can't seem to find these properties in the init.vm or jsp files

Any ideas?

Follow-up question: Should I be assigning users to different organizations? Or is assigning roles a better idea? No user will have any administrative permissions, the differences will solely be displayed in the views/theme.

Was it helpful?

Solution

You have to get user organizations by $user.getOrganizations(). And iterate over it using foreach

OTHER TIPS

The first answer is already there, regarding your follow up question,

You have to assign user to organization. Organization role will give the permission to user what he can perform for that organization and content related to that organization.

It is as simple as,

How can I approve vacation of my employees if I am not in the Human Resource Organization? So, I have to be part of Human Resources and then, I must have role like "Leave_Approver" which has permission to perform some actions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top