Visibility only when User is Admin

0
Hello,   I want to change the visibility for a button that only users which are the owner or when they are admin can see the Button.   I tried this: $currentObject/System.owner=[%CurrentUser%] or [%CurrentUser%]= System.Administrator   and also this   [%CurrentUser%]=  '[%UserRole_Administrator%]']   Nothing works. This is my Role definition:
asked
2 answers
1

Hello Fabian

 

What you need is for your user entity to have an association with Administration.Account or to set its a generalization to “Administration.Account”

 

Your page will have two versions of the same button e.g.

 

One of the buttons will handle the owner condition and will have a visibility similar to the following:

  • If the entity has an association with Administration.Account

  •  If the entity’s generalization is set to Administration.Account

 

And the other button will handle the condition of being an administrator and it should be like

answered
1

It's not the prettiest solution, but an option would be to determine visibility with a DS microflow that returns a helper object with a boolean. Note that visibility alone is not equal to security, so in the microflow behind the button I would do another check to make sure the user has the correct role / ownership.

answered