cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Filtering gallery by mutiple users - issue with using SharePoint Item permissions

HI

I had set up Item level permissions on my SPO list, to cater for users not being able to view content they had not created.

This caused issues around approvers in my form not being able to edit or even view items they had to approve, not sure if this is just by design and cant be fixed?

So temporarily I have changed the SPO list permissions to not be item level permission, and everyone can view or edit everything (so they are now normal list permissions).

When I had item level permissions set up no matter what I tried on the Items property of my gallery, it wouldn't display items for a test user if they were set as 1 of the approvers in the form.

I'd tried all of the below code with the test user name being in either DatacardValue33 (person field) and another in the actual DataCard Approver1 but I couldn't get the items they were approvers to show up, rather only items they had created would show, probably due to SPO item level perms kicked in?

This is my code on my Gallery Items property:

 

Filter(List, VarUser in MyApprovers)

//Filter(List, VarUser exactin MyApprovers)

//Filter(List,'Created By'.Email=VarUser || VarUser="email1.com" || VarUser = Approver1.Email || VarUser = Approver2.Value || VarUser = Approver3.Email || VarUser = "Email2.com")

//Filter(List,'Created By'.Email=VarUser || VarUser="email1.com" || VarUser = DataCardValue33.Selected.Email || VarUser = DataCardValue7.Selected.Value || VarUser = DataCardValue22.Selected.Email || VarUser = "Email2.com")

 

App OnStart to create MyApprovers this was set up to cater for the button to get to the gallery only being lit up if user was creator or an approver:

 

Set(MyApprovers,
Table({MyUser: DataCardValue33.Selected.Email},
     {MyUser: DataCardValue2.Selected.Email}, 
     {MyUser: DataCardValue7.Selected.Value}, 
     {MyUser: DataCardValue22.Selected.Email},
     {MyUser: DataCardValue44.Selected.Email}, 
     {MyUser: DataCardValue33_1.Selected.Email}
   ));

 



Having removed item level permission, now when I access the gallery, all the items are visible for this test users, which is again not what I want, Ideally I want a user to only see any items they have created and if they are 1 of the 3 approvers only those items should be visible for any user.

Sorry for the long post, but driving me insane

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @G99 ,

Do you want to display the Items in your Gallery if the user is the creator or has been assigned to a approver of the Item?

 

Based on the issue that you mentioned, I think you have something misunderstanding on data access permission between the canvas app and SP List.

 

Actually, the canvas app inherits data access permission from data source itself. If you set Item Level Permission in your SP List, this item permission would be inherited into your canvas app, so the current sign in user could only review these SP List Items which he created.

 

As an fixed solution, I agree with your thought almost. You could filter these SP List Items within your Gallery directly based on Column values ('Created By', Approvers columns) from your SP List using Filter function.

 

Please set the OnStart property of App to following:

Set(CurrentUserEmail, User().Email)

set the Items property of the Gallery to following:

Filter(
       List,
      'Created By'.Email = CurrentUserEmail ||
       Approver1.Email = CurrentUserEmail || 
       Approver2.Email = CurrentUserEmail || 
       Approver3.Email = CurrentUserEmail
)

Note: I assume that the Approver1, Approver2, Approver3 are all Person type columns in your SP List. Please remove the Item Level Permission from your SP List.

 

Please take a try with above solution, then re-load your app (fire OnStart property of App), check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @G99 ,

Do you want to display the Items in your Gallery if the user is the creator or has been assigned to a approver of the Item?

 

Based on the issue that you mentioned, I think you have something misunderstanding on data access permission between the canvas app and SP List.

 

Actually, the canvas app inherits data access permission from data source itself. If you set Item Level Permission in your SP List, this item permission would be inherited into your canvas app, so the current sign in user could only review these SP List Items which he created.

 

As an fixed solution, I agree with your thought almost. You could filter these SP List Items within your Gallery directly based on Column values ('Created By', Approvers columns) from your SP List using Filter function.

 

Please set the OnStart property of App to following:

Set(CurrentUserEmail, User().Email)

set the Items property of the Gallery to following:

Filter(
       List,
      'Created By'.Email = CurrentUserEmail ||
       Approver1.Email = CurrentUserEmail || 
       Approver2.Email = CurrentUserEmail || 
       Approver3.Email = CurrentUserEmail
)

Note: I assume that the Approver1, Approver2, Approver3 are all Person type columns in your SP List. Please remove the Item Level Permission from your SP List.

 

Please take a try with above solution, then re-load your app (fire OnStart property of App), check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,703)