I have a sharepoint custom list with customized item permissions.
The custom list item permissions is given to sharepoint groups.
How do I find out if the current looged in user has edit access to the chosen item?
Note: The current user is not the user who created the item.
For Example: List Item 1 has got these permissions:
ReadGrpA has read permissions.
EditGrpA, EditGrpB has edit permissions.
So in PowerApps when an UserB who is part of the EditGrpB chooses list item 1, the powerapp form must open in edit mode, else read mode.
Insert a TextBox1 and put this formula:
This will collect the GroupName based on the User logged in.
Then on the DefaultMode put this formula:
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution
Thanks for the reply.
Can you explain more please?
UserColumn what is that, I do not have a user column in my list.
I have only createdby and modified by columns in my list.
Also if the user chooses another item on the list, the user might have only read access.
I need to check item level permissions.
Am referring to a column in your permission table. What are the columns you have in your permission table where you have the various groups
Hi @prabhavs ,
There is no way to query a SharePoint security group from within PowerApps. It is currently "Under Review" - you can vote for it here.
The only solution for you would be to have a SharePoint list with the User's name in one field and the permission level in another.
There are two built-in user functions in Power Apps - User().FullName and User().Email. Neither are delegable in queries, so a variable needs to be set at App OnStart to properly query with them. I will also use the user's name here, but email address can work as well. In this case, you could also set the permission level and I have done this below. So assuming your list name is SPPermissions and the fields are NameUser and AccessLevel, you could do the following - App OnStart
Set(vUserName,User().FullName); Set( vLevel, Lookup( SPLevels, NameUser=vUserName, AccessLevel ) )
So then the FormMode of the form would be
If( vLevel = ReadGrpA, FormMode.View, FormMode.Edit )
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I was able to use flow and get the permissions for the given item for the logged in user.
Wish this was available in powerapps
Thanks to all for replying.
this is what i came up with, it can be improved.
I am using the basepermissions and usereffectivepermissions to check for edit permission
I have a flow which is triggered from powerapps
With following parameters
varSiteAddress, varListName, varListItemID, varUserClaims
Note: varuserclaims : "i:0#.f|membership|" & Lower(User().Email)
I declare 2 array variables,
varEditPermissionarray - permission object values for contribute, edit, fullcontrol.
varEditHighArray- this stores the high permission values for edit permissions
Send an Http request to get the role definitions
Apply to each roledefinitions
Append to array varEditPermissionArray , the base permissions
Within the same loop, check for the condition, before adding to EditHighArray., if the value exists in the EditHighArray.
Declare Variable hasPermissions String.
Declar VarEncodeUser and set the value to be function
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.