Fórum

Portlet configuration: Only display the Setup tab; hide/disable others

Patrick Stackpoole, modificado 13 Anos atrás.

Portlet configuration: Only display the Setup tab; hide/disable others

New Member Postagens: 21 Data de Entrada: 10/06/10 Postagens Recentes
As a user adding applications to my personal page, I have power to change each portlet's Preferences or Configuration. Ideally, I would only be able to edit the Preferences or Configuration:Setup. I'd rather not be shown the Permissions, Sharing, or Scope tabs that also appear in the same dialog box. Is there any easy option to arrange this?

Thanks,
Patrick
Oliver Bayer, modificado 13 Anos atrás.

RE: Portlet configuration: Only display the Setup tab; hide/disable others

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Patrick,

there is a relatively easy solution for this but you have to code a few lines. If you don't mind modifying some jsps it shouldn't be too hard to do.

Take a look at the following jsp: "html \ portlet \ portlet_configuration \ tabs1.jsp".

Which tabs are shown defines the "tabs1Names" variable.

So if you want e.g. to hide all other tabs if the user is on his/her page you can put sth like this at the end of the java-code-block of the mentioned jsp (pseudocode):
if (layout.isUser())
{
   tabs1Names = "setup";
}

So for all other pages like e.g. communities or organizations you can still use the default behaviour.

HTH Oli
Marcos Laurito, modificado 9 Anos atrás.

RE: Portlet configuration: Only display the Setup tab; hide/disable others

Junior Member Postagens: 99 Data de Entrada: 18/04/13 Postagens Recentes
I want to do this same thing but only for normal users because i, as an admin, need to keep all the configuration tabs.

Is this possible but specifing for wich users or roles i want to disable all tabs?
Oliver Bayer, modificado 9 Anos atrás.

RE: Portlet configuration: Only display the Setup tab; hide/disable others

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Marcos,

you can use the permissionChecker class to check for admin (isOmniadmin()) or use RoleLocalServiceUtil to check for a given role (hasUserRole(userId, roleId()).

HTH Oli
Marcos Laurito, modificado 9 Anos atrás.

RE: Portlet configuration: Only display the Setup tab; hide/disable others

Junior Member Postagens: 99 Data de Entrada: 18/04/13 Postagens Recentes
I assume this needs to change some code but i don't know where or how as i never did it before, is no other way?
Oliver Bayer, modificado 9 Anos atrás.

RE: Portlet configuration: Only display the Setup tab; hide/disable others

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Marcos,

afaik there are no magick properties to achieve that so yes you would have to code it. But it shouldn't be too hard if you use the Eclipse IDE + Liferay SDK to create a hook to override the mentioned jsp and add your custom logic. If you have any other questions feel free to ask again.

Oli