有的时候,我们想通过角色来控制 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