I have created custom buttons using the Command Bar designer. How do I hide certain buttons from certain security roles using the PowerFx formulas?
I have tried using the Ribbon Workbench XRM tool but when I load the solutions, these custom buttons are not showing in RIbbon Workbench.
So I guess my only option is to use PowerFx formulas on the Command Bar designer to hide buttons depending on the user's role. Can anyone help me work out how to get the user's security roles and hide the button from them?
RecordInfo( First(Accounts), RecordInfo.EditPermission )
because initially I was using only RecordInfo.EditPermission then it stopped working properly. Thanks for the clue.. I made it work with minor modification to your formula as below;
RecordInfo(Self.Selected.Item,RecordInfo.EditPermission) - On command Bar Visible property
There are permissions support for this in preview (Permissions support in DataSourceInfo and (new) RecordInfo functions for Dataverse | Microsoft Power Apps), which did not work well months ago, but probably worth trying again. Examples to try in the visible property of the command bar:
For a table:
For a particular record