在Liferay-Portlet中何处放置资源操作映射? [英] Where to place resource-action-mapping in Liferay-Portlet?

查看:64
本文介绍了在Liferay-Portlet中何处放置资源操作映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图基于

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.

我创建了一个具有以下内容的文件resource-actions.xml(portlet名称与portlet.xml和liferay-*.xml中指定的名称相同):

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>

没有定义模型资源,因为首先我只是想看看Liferay是否加载了我在映射文件中设置的权限.

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

我将文件放在文件夹中 -网络信息 -WEB-INF/类 -在Liferay的portal-impl.jar中 -...

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

但是新的权限TEST_PERM不会显示在控制面板->角色->定义权限->添加Portlet权限-> test-portlet 下.有人知道,我在这里做错了吗?

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?

推荐答案

我在Liferay官方论坛上发布了这个问题,并得到了不错的答复:

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

我之前已经遇到过这个问题,并将资源文件放在\ WEB-INF \ classes \ resource-actions中 我的resource-actions.zip已附加.希望对您有帮助

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

更新:
链接到Liferay论坛:

UPDATE:
Link to the Liferay-Forum: Where to place resource-action-mapping in Liferay-Portlet?

这篇关于在Liferay-Portlet中何处放置资源操作映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆