Restricting access to parts of an App

Restricting access to parts of an App

avatar
(anonymous user)

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.

All Comments (4)

avatar

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”
….
}

avatar

There’s also Protect-UDSection.

docs.powershelluniversal.com

avatar

I use protected section and it works well,

example

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

any UI elements here

}

avatar

Thanks! Worked Perfectly