Tuesday, December 28, 2021

Get User Permissions From SharePoint Group In PowerApps: Part 1

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.

  1. 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.
  2. 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.
  3. Part 3: We will fetch Role Assignments and parse the JSON output.
  4. Part 4: For each Role Assignment, we will fetch Member, RoleDefinition Bindings and Users and parse their JSON.
  5. 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.
So, let's start.

  1. First, we will create SharePoint groups-
    1. TestDesignEditGroup (Design, Edit)
    2. TestGroup (Full Control)


  2. We had added users to them. We had added users to TestGroup as-
  3. We had added below users in "XXXX Owners" group-
  4. 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.
  5. Go to list settings, click on "Permission for this list", break the inheritance of permissions and give unique permissions as below-


  6. 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.