Hello Friends,
Welcome back with some new topics. Sometimes, we have a situation, where we need to get the permissions assigned to the logged-in user in SharePoint list. However, we know that PowerApps, only fetches Azure AD groups. So, is there any possibility to achieve this? Initially, I was expecting the same. But, where there is a will, there is a way. Finally, I have prepared the workaround to achieve this. We will be discussing this workaround in a series of posts.
- Part 1: We will create a list, couple of SharePoint groups, add couple of users in these groups, break inheritance of list and assign some of these groups to that list.
- Part 2: We will create a Power Automate (Instant cloud flow >> PowerApps) that will serve the purpose. Then we will initialize some variables that will be used to capture data at different stages.
- Part 3: We will fetch Role Assignments and parse the JSON output.
- Part 4: For each Role Assignment, we will fetch Member, RoleDefinition Bindings and Users and parse their JSON.
- Part 5: For each user, we will match if the user is which we are looking for then we will append the permissions from RoleDefinitionBindings into a variable.
- First, we will create SharePoint groups-
- TestDesignEditGroup (Design, Edit)
- TestGroup (Full Control)
- We had added users to them. We had added users to TestGroup as-
- We had added below users in "XXXX Owners" group-
- Now, we will create a list in SharePoint named "TestListSJ". I am not going to add any item in this list therefore not adding any further column.
- Go to list settings, click on "Permission for this list", break the inheritance of permissions and give unique permissions as below-
- This completes our Part 1. In Part 2, we will initialize variables to capture data.
With this, I am concluding this post.
Happy Coding !!!
Will see you again with some new topics.
Stay Safe !
Stay Healthy !
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.