Disable a UI (like an admin button) in a compose page

Hello,

Is it possible to disable an automation button for certain users/roles (depending on the workflow permissions).

I’m trying to replicate the states (enabled/disabled) of the edit and delete buttons depending of permssions.

1 Like

After some reflections here are some ideas on how to achieve this :

  • Create two different pages of the same record : one for user-level1 and another for user-level2 with the button. With a workflow based on user roles, we can redirect to a page or the another.
    With the version 2022.9, two views for the same record is not allowed but this might come in the future.

  • Inject a js script to hide an element like the button. The problem is that HTML elements are not well identified (ID or class).

  • With client scripts, I didn’t find any solution because of the luck of an appropriate event in ui:compose:record-page ( like before(‘pageLoad’) ).

  • UI block doesn’t have permission management. And apparently, this is not planned in the near future.

Does anyone have other ideas on how to achieve this ?

1 Like

UPDATE for version 2023.3 :

  • Point 1 : it’s now possible to show different layouts based on a specific role