views:

465

answers:

2

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

I created a file resource-actions.xml with the following content (portlet-name is identical to the name specified in portlet.xml and liferay-*.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>

There is no model-resource defined, because first I just want to see, if Liferay loads the permissions I set in the mapping file.

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

But the new permission TEST_PERM does not show up under Control Panel -> Roles -> Define Permissions -> Add Portlet Permissions -> test-portlet. Does anybody know, what I am doing wrong here?

+1  A: 

I posted this question in the offical Liferay forum and got a nice reply:

I've faced this before and placed resource file in \WEB-INF\classes\resource-actions my resource-actions.zip is attached. hope it helps

UPDATE: Link to the Liferay-Forum: http://www.liferay.com/community/forums/-/message_boards/message/4773580?_19_redirect=/community/forums/-/message_boards/search%3f_19_redirect%3d%252Fweb%252Fguest%252Fcommunity%252Fforums%26_19_breadcrumbsCategoryId%3d0%26_19_searchCategoryId%3d0%26_19_keywords%3dbertolt

Bertolt
A: 

Hi,

Could you post the link to the liferay forum?

Thanks.
José

José

related questions