Looking for Unique permissions

Brass Contributor

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?

3 Replies

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.

 

https://msdn.microsoft.com/EN-US/library/microsoft.sharepoint.client.securableobject.hasuniqueroleas...

 

 

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

 

 

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