0
votes
i m using liferay6.2 ga2 i want to hide mysites from dockbar for all users except admin user .i know its possible through hook and referred the below link

http://findnerd.com/list/view/Hiding-My-Sites-Menu-in-Docbar-in-Liferay/1940/

but inside dockbar portlet in view_my_sites.jspf which part of the code must be modified.

can anybody please provide solution how view_my_sites.jspf file must be modified or any informative reference about hiding my sites option from dockbar.

thanks in advance

3

3 Answers

0
votes

Helo Heena,

You must implement in your Theme a logic to restrict this.

I remember that this logic must be included into portal-normal.vm accessing ThemeDisplay Object.

It should be something like this:

set ($expando= $themeDisplay.getScopeGroup().getExpandoBridge())
set ($group = $expando.getAttribute("isAdmin"))
if ($isAdmin!= true)
     set ("Logic to enable or disable options")
end

I hope that this could be useful for you.

0
votes

Hi if you look into the init.vm or init.ftl and search for my sites you see couple of variables there. I would expect that setting the show_my_sites to false would make the my site option disappear (needs to be tested).

To detect, if the current user is admin i would user permissionChecker.isOmniadmin(). The permissionChecker variable is available in the context. The other option is to get user roles and check if the user has a specific role.

0
votes

If you are willing to hide 'Go To' option from the dock bar of Liferay for non-admin users, then please navigate to {TOMCAT_HOME}\webapps\ROOT\html\portlet\dockbar and open the 'view.jsp' and search for the if condition "> and replace the same with the ">. Thanks.