Skip to Content

Controlling visibility of UI elements in SAP fiori app based on data from backend ?

Hi Experts !

I was wondering if it is a suitable approach to develop and control ui element visibility from backend, when there is one application which is common to more than one role and only differs in access to certain buttons on the page among these roles? rather than create three different roles.

For instance an application to view a document which is same for Employee and Manager with only difference that manager gets to approve the report other than viewing it in display mode. In this case, controlling the visibility of Approve button from Odata service where from back-end we can return a variable to enable and disable button if the logged in user is a manager.

Regards.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 07, 2020 at 07:09 AM

    I think that this is possible but probably not the most elegant solution.

    If you want to do it this way, you definitely need to implement an authorisation check in the button, even if it is set to invisible.

    An alternative would be to create the button based on backend data via javascript. It would not be in the xml if it's not created via js, so that might be a safer alternative.

    But these are not official recommendations, just my personal thoughts.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 24, 2020 at 07:54 PM

    Hi Anusha,

    you can do that sending a bool from backend set visible false. but you should also control role/authroziation in approving method in backend.

    Add a comment
    10|10000 characters needed characters exceeded