SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a 2010 site that has many documents in many different folders. I believe a number of them have broken permission inheritence. Is there a way i can code a C# console app to utilise client object model, go through my libraries and check if a document has unique permissions?

I have done the standard google, checked msdn and nothing turns up. It seems to be a unique problem.

Thanks for any help you can provide.

share|improve this question
up vote 1 down vote accepted

Actually yes it is (details here One important note though - simple Load statement with a ListItemCollection parameter (i.e. ctx.Load(lic)) does not load 4 properties of ListItem by default when you return list items: DisplayName, EffectiveBasePermissions, HasUniqueRoleAssignments, and RoleAssignments. If you tried to reference them in your code, you will get a Property not initialized error.

To get beyond that you need to specifically ask to have them included when you define your query using, by example the IncludeWithDefaultProperties

function retrieveProperties () {

    var clientContext = new SP.ClientContext('/sites/TestWebs/TestWeb1');
    this.oWebsite = clientContext.get_web();

    clientContext.load(oWebsite, 'Title', 'HasUniqueRoleAssignments');

    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

function onQuerySucceeded() {
    alert('Title: ' + oWebsite.get_title() + 
    '\nUnique role assignments: ' + oWebsite.get_hasUniqueRoleAssignments());

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
share|improve this answer
I've updated the response with an example straight from MSDN – Marius Constantinescu - MVP Apr 8 '13 at 13:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.