Portlet中何处放置资源操作映射

Portlet中何处放置资源操作映射

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

问题描述

我试图基于 Liferay的文档.由于Portlet将以战争包装的形式交付,因此我想在Portlet自身内部维护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:

更新:
链接到Liferay论坛:在Liferay中将资源-动作映射放置在哪里

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

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