Oct 22 2017 02:30 PM
Hi,
I'm looking for the property on a list or folder that says if any children have broken inheritance (i.e. if any child items have unique permissions). I know I can do a separate query to find all item in a folder where HasUniquePermissions eq true, but I want to avoid the extra call. I thought there was a property on the parent folder that tells whether any children have broken inheritance, but I cant seem to find it.
Oct 23 2017 05:13 AM
maybe this link can help you with your search https://www.codeproject.com/Articles/678653/How-to-check-user-permission-for-the-web-list-or-S
Oct 23 2017 02:59 PM - edited Oct 23 2017 02:59 PM
Hi Russell,
As far as I know, there is no such a property.
If your folder structure is predictable some subsidiary objects' properties can be expanded. Here is the sample in PnP JS Core (as I can recall you use the lib) which represents the idea:
pnp.sp.web.getFolderByServerRelativeUrl(`${_spPageContextInfo.webServerRelativeUrl}/Shared%20Documents`) .folders .select('Name,ServerRelativeUrl,ItemCount,Folders/ListItemAllFields/HasUniqueRoleAssignments,Files/ListItemAllFields/HasUniqueRoleAssignments') .expand('Folders/ListItemAllFields/HasUniqueRoleAssignments,Files/ListItemAllFields/HasUniqueRoleAssignments') .get() .then(results => { return results.map(result => { return { ...result, HasUniqueRoleAssignmentsForFolders: result.Folders.results.filter(folder => { return folder.ListItemAllFields.HasUniqueRoleAssignments; }).length > 0, HasUniqueRoleAssignmentsForFiles: result.Files.results.filter(file => { return file.ListItemAllFields.HasUniqueRoleAssignments; }).length > 0 } }); }) .then(results => { console.log(results); }) .catch(console.log);