1.ext环境下配置权限:
在src的portal-impl/src 下找到resource-actions文件,里面的xml文件是对应portlet的权限配置文件,将要修改权限的xml复制到ext的同目录下,修改xml内容,deploy后该xml会替换src中的同名配置文件。
同理,想要给新的portlet添加权限,也要在同目录下配置与portlet同名的xml权限配置文件。
2.plugin:
WEB-INF下的web.xml 中:<context-param>
<param-name>portlet_properties</param-name>
<param-value>portlet.properties</param-value>
</context-param>
指向WEB-INF/classes下的portlet.properties:
<!--导入和覆盖源portlet-ext.properties-->
include-and-override=portlet-ext.properties
<!--语言文件指定-->
language.bundle=content.Language
<!--指向WEB-INF/classes/resource-actions/default.xml配置文件-->
resource.actions.configs=resource-actions/default.xml
default.xml:
<?xml version="1.0"?>
<!--设置find friend portlet的权限及角色的默认权限-->
<resource-action-mapping>
<portlet-resource>
<portlet-name>find_friend</portlet-name>
<supports>
<action-key>Opt</action-key>
<action-key>Search_Settings</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
<community-defaults>
<action-key>VIEW</action-key>
</community-defaults>
<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>
<guest-unsupported />
</portlet-resource>
</resource-action-mapping>
3.权限名字在language-ext.properties中定义,如OPT->action.Opt=OPT.