In this article we can explore the REST API to check User Permission for a Group.
You are working in a client-side script SharePoint App. You need to check whether the current user belongs to the Approvers group. The twist is that the current user is added to an AD Group and in turn the AD Group was added to SharePoint group.
Solution: Following is the REST code to get the result.
Following is the result.
If I enter an invalid group name, the result will be different.
We can also check Site Collection & Sub Site permission groups using the same way.
The above code is checking does the user have View Membership permission. In order to make this work we need to configure the following group property as true.
By default this property will be true.
You can find more property information using References link.
In this article we have explored the REST API to check User Permission for a Group.