Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
Unanswered

Restrict who can edit forms

(0) ShareShare
ReportReport
Posted on by 16

Hi everyone,

 

I'm trying to restrict who can edit a form within my app to a set Super Users list and also to people identified as owners within the form. I'm aware that people could still go directly to the SharePoint list and edit from there but that's not really a worry for my deployment.

 

I have a list that contains who is a Super User and that is connected to my app along with the normal list.

When my app launches, this runs OnStart

Set(SuperUsers, LookUp('Super Users', Title = User().Email))

Each form has 2 fields that are people pickers. First one is 'Person Responsible' and the other is 'PI(s)'. So the idea is that everyone who is a Super User, plus the Person Responsible and PI(s) can edit and everyone else is restricted to view for a particular item.

 

I took a look at this and amended it to the following to no success. I left out the PI(s) to test to see if it works.

If(SuperUsers.IsSuperUser|| 
 ThisItem.'Person Responsible'.Email=User().Email,
 FormMode.Edit,
 FormMode.View)

 

Would anyone be able to help please?

Thanks

Categories:
  • LT91 Profile Picture
    16 on at
    Re: Restrict who can edit forms

    I've had a bit of a play and can't seem to get this to work as intended so will have to have another think and try another way.

     

    @EricRegnier  It's just linked to a sharepoint list but I don't have access to the security roles unfortunately otherwise I would give this a try.

     

    Thanks for the help both.

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Restrict who can edit forms

    Hi @LT91,

    Are you using Dataverse/CDS as the database? If I would configure the security roles and check then in the canvas app to set the display mode. That way, security will also apply at the database and API level, and any other UI areas so it would be more "secure". More info on security: https://docs.microsoft.com/power-platform/admin/security-roles-privileges 

    Cheers

  • Pstork1 Profile Picture
    66,342 Most Valuable Professional on at
    Re: Restrict who can edit forms

    Its not really security, but for that I would use a separate screen for the New form and the Edit form.  Then set the displayMode for the control that navigates to the Edit form to disabled if the CurrentUser's email isn't in a collection of Super User emails.  So what you are looking for is something like this.

    In OnStart
    Set(CurrentUser, User.Email)
    ClearCollect(SuperUsers, Filter('Super Users', Title = User().Email))
    
    On Control to navigate to Edit
    If(CurrentUser in SuperUsers,DisplayMode.Edit, DisplayMode.Disabled)
  • LT91 Profile Picture
    16 on at
    Re: Restrict who can edit forms

    @Pstork1apologies, I probably should have mentioned that this is in relation to the data on the form and not editing the app itself.

     

    So more about restricting who can edit data within the app (I'm not concerned about sharepoint permissions at this time). Everyone needs to be able to create a new item through the form, but unless you are listed as a Super User or are listed in the fields 'Person Responsible' or 'PI(s)' you cannot edit the data through the app.

     

    Thanks.

  • Pstork1 Profile Picture
    66,342 Most Valuable Professional on at
    Re: Restrict who can edit forms

    To restrict who can edit the app just make sure to remove their co-owner access when you share the app.  That will keep them from editing the app itself, but they will still be able to use the app.

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Governance and Administering

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 11 Super User 2025 Season 1

#2
bscarlavai33 Profile Picture

bscarlavai33 5 Super User 2025 Season 1

#3
getsplash Profile Picture

getsplash 2

Overall leaderboard

Featured topics