How can you efficiently determine if any of the items in a List don't inherit their security from the List?

You could use SPListItem.HasUniqueRoleAssignments but this would require iterating through all items in the List.

2 Answers 2


Leading on from @tylerrrr07's answer, there's another overload of GetItemsWithUniquePermissions which may be of use to you:

MSDN: SPList.GetItemsWithUniquePermissions Method (int maxItemToReturn, bool folderOnly)

You could then avoid the potentially huge result set from running the method by using the following:

SPList.GetItemsWithUniquePermissions(1, false).Count == 1
  • 1
    If this actually bypasses the SPQueryThrottledException issue (which I imagine it should) its a great solution. Thanks for pointing this out. Feb 29, 2012 at 14:45
  • @tylerrrr07: Thanks. The exception description seems to indicate that it's triggered by the size of its own result set; but of course that's no guarantee.
    – Stu Pegg
    Feb 29, 2012 at 14:56

Haven't tested it myselt but it looks like you could do something along the lines of

SPList.GetItemsWithUniquePermissions().Count > 0;
  • A minor problem with this solution is that all the list items have with item-level permissions are returned by the function (which may be all of them). This in turn may cause it to throw an SPQueryThrottledException: msdn.microsoft.com/en-us/library/ee572463.aspx
    – Stu Pegg
    Feb 29, 2012 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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