Foren

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

Patrick Stackpoole, geändert vor 13 Jahren.

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

New Member Beiträge: 21 Beitrittsdatum: 10.06.10 Neueste Beiträge
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, geändert vor 13 Jahren.

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

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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, geändert vor 9 Jahren.

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

Junior Member Beiträge: 99 Beitrittsdatum: 18.04.13 Neueste Beiträge
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, geändert vor 9 Jahren.

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

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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, geändert vor 9 Jahren.

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

Junior Member Beiträge: 99 Beitrittsdatum: 18.04.13 Neueste Beiträge
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, geändert vor 9 Jahren.

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

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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