Role permissions for menu item bean

Hello,

I have the following menu item bean created that opens a new browser tab:

<item bean="dashboardsPopoutBean" beanMethod="popOutDashboards" caption=" " 
id="dashboards-popout" icon="SHARE_SQUARE_O" description="Popout Dashboards"/>

I can’t seem to find a way to control this using a role, so only full-access-role users can see it. I’ve referenced the following forums posts, but can’t find a way to get this to work:

Also, is there a way to set the menu item to icon-only? As you can see above, the only thing I can get to work is using a space as a caption.

Thanks in advance,
Adam

Hello!

Menu policies are applied by menu item id. For the bean with method Jmix generates id by the following rule:
value from bean attribute plus value from beanMethod separated by #:

dashboardsPopoutBean#popOutDashboards

In your case menu item contains an id, so you should define this id in @MenuPolicy:

@MenuPolicy(menuIds = "dashboards-popout")
void dashboardMenuPolicy();

The only way is setting caption empty. Otherwise it will generates caption with “menu-config.” + id.