cancel
Showing results for 
Search instead for 
Did you mean: 

Are there any options to control visibility of UI5 controls based on roles

Hi Experts,

Since some time there has been a question circulating the web - is it possible to hide UI controls based on user roles? but maybe there has been some developments in this area since 2015.

Scenario: In the CDS based MTA UI5 app there are 5 possible actions, 3 actions are available for all users, but 4. action should be allowed only if the user has the specific role assigned. For last action users with "role A" can view the data, and users with "role B" can also change data.

Undoubtedly the backend check for authorization has been implemented, but how to handle the visibility of allowed action buttons on the frontend side? Can CF roles be somehow utilized? or XS scopes? Or still the best option is to send some parameter from backend top control layout?

Thanks a lot in advance,

Shan

View Entire Topic
OliverGraeff
Product and Topic Expert
Product and Topic Expert

Hello Shanir,

We are working on covering this in the UI layer, i.e. SAPUI5. As SAPUI5 flexibility needs implementations per technology platform, we need to look at the road map of SAP standard delivery with different priorities:

  • specifically for the UI5 control sap.ui.fl.VariantManagement this is planned for SAP BTP, CF environment in September 2022, see this road map item.
  • for all controls (covering your button I assume) we plan for SAP BTP, ABAP environment (this road map item moves to Q1/2023), followed by other platforms including CF. Unfortunately we have no timeline for CF yet, but it is planned to show up in the SAPUI5 road map.

Until then an own solution can be a workaround, e.g. via an explicit parameter.

Please note that as usual with forward-looking statements, these are subject to change.

Regards,
Oliver

Richie
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Oliver, was this ever implemented? We have actions defined as action activate @(requires: 'MyRole.Activate'), but would like to also hide the button on the UI using the ![@UI.Hidden] annotation but based on role? Is this possible yet?
OliverGraeff
Product and Topic Expert
Product and Topic Expert
0 Kudos
@Richie The capabilities of SAPUI5 flexibility I mentioned have been delivered, please see the linked road map items -> Features
Richie
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks for the update. I see it can be done with Key-user adaptation, but was hoping it could be done with annotations.