现在的位置: 首页 > 综合 > 正文

Liferay : 如何根据角色来控制 dock 的显示与否

2013年08月21日 ⁄ 综合 ⁄ 共 579字 ⁄ 字号 评论关闭

 有的时候,我们想通过角色来控制 dock(dock.vm)  块来进行显示控制。如果是某个角色就显示,如果不是,就不显示。

具体做法步骤如下:

 

   1:  simply create a new  resource-action associated with Layout called VIEW_DOCK.

   2: Then simply check that permission which you can then assign to any Roles you need.
              代码: $layoutPermission.contains($permissionChecker,$getterUtil.getLong($plid), "VIEW_DOCK")
   3:修改资源配置文件communities.xml
        copy portal-impl.jar!/resource-actions/communities.xml to
        ROOT/WEB-INF/classes/resource-actions/communities.xml
        add the following line after line ~28 :
    <action-key>VIEW_DOCK</action-key>

 

 4: configure role

 

 5: test and end

抱歉!评论已关闭.