Where to place resource mapping in the Liferay-Portlet?

I am trying to add permissions to a Liferay-Portlet based on the Liferay documentation . Since the portlet will be delivered in a war package, I want to determine the portlet permissions inside the portlet itself.

I created a resource-actions.xml file with the following contents (the portlet name is the same as the name given in portlet.xml and liferay is *. Xml):

<?xml version="1.0"?> <resource-action-mapping> <portlet-resource> <portlet-name>test-portlet</portlet-name> <supports> <action-key>SELECT</action-key> <action-key>VIEW</action-key> <action-key>TEST_PERM</action-key> </supports> <community-defaults> <action-key>VIEW</action-key> </community-defaults> <guest-defaults> <action-key>VIEW</action-key> </guest-defaults> </portlet-resource> 

An undefined resource model is defined, because at first I just want to see if Liferay loads the permissions specified in the mapping file.

I placed the file in the folders - WEB-INF - WEB-INF / classes - inside the portal-impl.jar Liferey -...

But the new permission TEST_PERM is not displayed in the control panel → Roles → Define permissions → Add portlet permissions → test portlet. Does anyone know what I'm doing wrong here?

+4
source share
1 answer

I posted this question on the official Liferay forum and got a nice answer:

I came across this before and placed the resource file in \ WEB-INF \ classes \ resource-actions my resource -actions.zip is attached. hope this helps

UPDATE:
Liferay-Forum Link: Where do I host the resource mapping in the Liferay-Portlet?

+4
source

Source: https://habr.com/ru/post/1305438/


All Articles