Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no such thing as a <em>List Administrator</em>. But you can get the users and groups with manage lists permissions though:</p> <pre><code>SPList list = // get your list IEnumerable&lt;SPPrincipal&gt; admins = list.RoleAssignments.Cast&lt;SPRoleAssignment&gt;() .Where(ra =&gt; ra.RoleDefinitionBindings.Cast&lt;SPRoleDefinition&gt;() .Any(r =&gt; (r.BasePermissions &amp; SPBasePermissions.ManageLists) == SPBasePermissions.ManageLists)) .Select(ra =&gt; ra.Member); </code></pre> <p><strong>Update:</strong> </p> <p>Permissions on a <code>SPFolder</code> can be checked via the corresponding <code>SPListItem</code>. This can be retrieved via the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfolder.item.aspx" rel="nofollow"><code>SPFolder.Item</code></a> property. Since both, the <code>SPListItem</code> and the <code>SPList</code>, inherit from the <code>SPSecurableObject</code> the check for the <code>SPListItem</code> is the same as described above.</p> <p>To distinguish <code>SPUser</code> from <code>SPGroup</code> simply check the type of <code>SPRoleAssigment.Member</code>:</p> <pre><code>IEnumerable&lt;SPUser&gt; adminUsers = admins.OfType&lt;SPUser&gt;(); </code></pre> <p>Be aware that a <code>SPUser</code> object can represent an AD security group. This can be checked via the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spuser.isdomaingroup.aspx" rel="nofollow"><code>SPUser.IsDomainGroup</code></a> property.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload