Restricting access to parts of an App

Is it possible to have some functions of an app restricted to specifc roles?

I have an app that has an edit button that is used to edit the values that are displayed. but I would like to make it so ony people with an “Editor” Role are able to see the Edit button.

is something like this possible?

Thanks in Advance.

yes, i cant tell you exactly how to do it (i dont have access to work now)
but it is something like this:
if ($Roles -eq “Editor“) {
new-udbutton “Button”
….
}

There’s also Protect-UDSection.

I use protected section and it works well,

example

Protect-UDSection -Role @(‘admin’,‘poweruser’) -Content {

any UI elements here

}

Thanks! Worked Perfectly