Search code examples
liferayliferay-6liferay-theme

Checking User's Organization in Liferay


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.


Solution

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