0

I want to remove a "delete" action button from the "user-profile-portlet". I am not core Liferay developer so facing this issue. Any help would be appreciated:

Sample code:

<portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" var="editUserPortraitURL">
    <portlet:param name="jspPage" value="/edit_user_portrait.jsp" />
    <portlet:param name="redirect" value="<%= currentURL %>" />
    <portlet:param name="p_u_i_d" value="<%= String.valueOf(user.getUserId()) %>" />
    <portlet:param name="portrait_id" value="<%= String.valueOf(user.getPortraitId()) %>" />
</portlet:renderURL>

<liferay-ui:logo-selector
    currentLogoURL="<%= user.getPortraitURL(themeDisplay) %>"
    defaultLogoURL="<%= UserConstants.getPortraitURL(themeDisplay.getPathImage(), user.isMale(), 0) %>"
    editLogoURL="<%= editUserPortraitURL %>"
    imageId="<%= user.getPortraitId() %>"
    logoDisplaySelector=".user-logo"
    showBackground="<%= false %>"
/>
Kushal Jayswal
  • 925
  • 1
  • 12
  • 31

2 Answers2

1

I recomemend you not to modify directly the portlet, but to modify the permission for the roles that you consider. Here it is explained:

https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/roles-and-permissions

If it is not enough, you can create a hook that will overwrite the jsp you need to modify. For doing this, I recommend you following this:

https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/customizing-jsps-by-extending-the-original

Good luck!

0

liferay-ui:logo-selector is the tag which displays image and other change and delete control buttons.

Below file is responisble to render that part. https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/taglib/ui/logo_selector/page.jsp

You have to customize this jsp using hook plugins as mentioned in the link given in @Doc Manhattan's answer.

Pankaj Kathiriya
  • 4,210
  • 2
  • 19
  • 26