界面元素权限无法设置更深层的组件

项目是新建的(7.1.1),
通过Intellij CUBA插件创建了一个topMenu,自动生成的代码(继承的MainScreen),然后我加入了几个组件到 initialLayout 标签里,完整代码(ext-main-screen.xml)如下:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
        caption="mainMsg://application.caption">
  <layout expand="foldersSplit">
    <hbox id="titleBar"
          stylename="c-app-menubar"
          expand="mainMenu"
          width="100%"
          spacing="true"
          margin="false;false;false;true">
      <image id="logoImage"
             align="MIDDLE_LEFT"
             scaleMode="SCALE_DOWN"
             stylename="c-app-icon"/>
      <menu id="mainMenu"
            align="MIDDLE_LEFT"/>
      <ftsField id="ftsField"
                align="MIDDLE_LEFT"/>
      <userIndicator id="userIndicator"
                     align="MIDDLE_LEFT"/>
      <timeZoneIndicator id="timeZoneIndicator"
                         align="MIDDLE_LEFT"/>
      <hbox id="mainButtonsBox"
            stylename="c-main-buttons"
            align="MIDDLE_LEFT">
        <newWindowButton id="newWindowButton"
                         icon="app/images/new-window.png"
                         description="mainMsg://newWindowBtnDescription"/>
        <logoutButton id="logoutButton"
                      icon="app/images/exit.png"
                      description="mainMsg://logoutBtnDescription"/>
      </hbox>
    </hbox>
    <split id="foldersSplit"
           width="100%"
           orientation="horizontal"
           pos="200px">
      <foldersPane id="foldersPane"
                   width="100%"
                   height="100%"/>
      <workArea id="workArea"
                width="100%"
                height="100%">
        <initialLayout id="initialLayout" spacing="true" margin="true" expand="portal">
          <label value="欢迎!" stylename="huge gray1" align="MIDDLE_CENTER"/>
          <fragment id="portal" screen="cy_PortalFragment"/>
        </initialLayout>
      </workArea>
    </split>
  </layout>
</window>

就是这个我设置的 idportal 的 fragment 在角色的界面元素权限里面的树形菜单(topMenuMainScreen)里没有这个 portal,请问这是什么问题呢,谢谢。

%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20191012165019

PS: portal(fragment)是自己加的,里面就一个label,然后角色的界面权限中这个Fragment也是授予了允许,即使我在界面元素权限里手动加入 id 为 portal 的组件后,匿名用户还是无法显示这个fragment

PS2: 我重启之后就能正确展示这个组件了,这个必须重启app才行么?

是的,组件树是有缓存的。第一次加载的时候会做缓存。所以后续的更新是需要重启服务的。

那有相关的接口可以更新组件权限的吗

ScreensHelper不是 MBean,所以系统没有提供默认的办法清理缓存。不过,对应的方法是 ScreensHelper#clearCache 可以简单扩展一下权限管理界面,把清理的 action 做个按钮。

不过,这种实时刷新组件树的功能也就在开发阶段有用吧,这样的话,重启也是可以接受的。