0

Is there a way we can test if the current web is inheriting permission from the parent web. list items have HasUniqueRoleAssignments property that tells if the list is inheriting or has unique permission. But web doesn't have something looks like.

Do SharePoint webs have something similar.

user388969
  • 337
  • 1
  • 9
  • 30

1 Answers1

1

The web object does indeed have HasUniqueRoleAssignments. It's not listed in the documentation, but it's there. In JS:

var context = SP.ClientContext.get_current();
var web = context.get_web();
context.load(web, 'HasUniqueRoleAssignments');
context.executeQueryAsync(function(){
    if (web.get_hasUniqueRoleAssignments())
        console.log("It's unique!");
    else
        console.log("It inherits!");
}, function(){alert('Oopsie!')});
Andrew Ridgway
  • 574
  • 2
  • 9