Forum Discussion
Looking for Unique permissions
Is there any feature on the CSOM API, or any other to check if an element (Site/Web/Folder) have child items with unique permission underneath it.
I dont want do a an expensive operation going deep into the childs, but I see the info exposed on the SP UI when you add/remove permissions
Any info?
- paulpaschaBronze Contributor
ListItems, Lists and Sites all inherit from SecurableObject which has a property "HasUniqueRoleAssignments". As far as I know the only way for you to check if any of the child items of a SecurableObject has unique permissions applied is to pick a parent (List or Site) and loop through its children and for each one of them check the property.
- Raul GaritaBrass Contributor
Thanks Paul, I'm not sure, if it goes to all the childs. But I also found the following extension on the PnP-sites-core library. Ill check
GetAllUniqueRoleAssignments
- Deleted
Raul Garita this function does:
Get all unique role assignments for a web object and all its descendents down to document or list item level.