Reputation: 570
I want to hide top menu navigation bar when user role is "ERP USER", logout link should be remains there. or how to remove navigation item "My Profile", "My Account" & "My Dashboard". due to some security access in third party application i need to disable this navigation items.
Can anybody explain me how to accomplish my requirement?
Thanks!!!
Upvotes: 1
Views: 6707
Reputation: 115
You can remove navigation bar using Liferay theme from portal_normal.vm for specific user. Apply this theme to your current site.
Upvotes: 0
Reputation: 619
You can remove My Profile, My Dashboard and Control Panel entries by modifying portal configuration, the rest requires some development. First two will disappear if you set followig options in portal-ext.properties to false:
#
# Set whether or not private layouts are enabled. Set whether or not private
# layouts should be auto created if a user has no private layouts. If
# private layouts are not enabled, then the property
# "layout.user.private.layouts.auto.create" is assumed to be false.
#
layout.user.private.layouts.enabled=true
layout.user.private.layouts.auto.create=true
#
# Set whether or not public layouts are enabled. Set whether or not public
# layouts should be auto created if a user has no public layouts. If public
# layouts are not enabled, then the property
# "layout.user.public.layouts.auto.create" is assumed to be false.
#
layout.user.public.layouts.enabled=true
layout.user.public.layouts.auto.create=true
That you will disable User's private and public pages (and remove them from dockbar).
To get rid of Control Panel, you have to revoke Access Control Panel permission in Roles configuration (usually for User role).
Your other two requirements - hiding My Profile or removing Dockbar will require more effort.
To get rid of My Profile you will need to create JSP hook for Dockbar portlet (in version 6.2 it should be https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/dockbar/view_user_account.jspf).
The easiest way to hide dockbar for specific role is to implement role checking in portal_normal.vm/ftl of your theme. In standard unstyled_ theme you have to change the following lines https://github.com/liferay/liferay-portal/blob/6.2.0-ga1/portal-web/docroot/html/themes/_unstyled/templates/portal_normal.ftl#L21-L23
Upvotes: 2