Permissions.GetPermissionCollection Method

Returns the collection of permissions for a site or list.

Namespace:  [Permissions Web service]
Web service reference: http://Site/_vti_bin/Permissions.asmx

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/directory/GetPermissionCollection", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/directory/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/directory/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetPermissionCollection ( _
    objectName As String, _
    objectType As String _
) As XmlNode
'Usage
Dim instance As Permissions
Dim objectName As String
Dim objectType As String
Dim returnValue As XmlNode

returnValue = instance.GetPermissionCollection(objectName, _
    objectType)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/directory/GetPermissionCollection", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/directory/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/directory/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetPermissionCollection(
    string objectName,
    string objectType
)

Parameters

  • objectName
    Type: System.String

    A string that contains the name of the list or site.

  • objectType
    Type: System.String

    A string that specifies either List or Web.

Return Value

Type: System.Xml.XmlNode
An XML fragment in the following form that can be assigned to a System.Xml.XmlNode object:

<GetPermissionCollection xmlns="https://schemas.microsoft.com/sharepoint/soap/directory/">
   <Permissions>
      <Permission MemberID="1073741829" Mask="-1" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Administrator" />
      <Permission MemberID="1073741828" Mask="1029638927" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Web Designer" />
      <Permission MemberID="1073741827" Mask="1027801615" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Contributor" />
      <Permission MemberID="1073741826" Mask="138608641" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Reader" />
      <Permission MemberID="1073741825" Mask="134283264" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Guest" />
      <Permission MemberID="1073741830" Mask="134414337" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Site_Group1" />
      <Permission MemberID="1073741831" Mask="134283265" MemberIsUser="False" MemberGlobal="False" 
         RoleName="Site_Group2" />
         .
         .
         .
</GetPermissionCollection>

Remarks

To access the Permissions service and its methods, set a Web reference to https://Server_Name/[sites/][Site_Name/]_vti_bin/Permissions.asmx. This example requires that a using (C#) or Imports (Microsoft Visual Basic) directive be included for the System.Xml namespace.

Examples

The following code example displays the set of permissions for a specified list on the current site.

Dim permService As New Web_Reference_Folder_Name.Permissions()
permService.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim ndPermissions As XmlNode = permService.GetPermissionCollection("List_Name", "List")

MessageBox.Show(ndPermissions.OuterXml)
Web_Reference_Folder_Name.Permissions permService = new Web_Reference_Folder_Name.Permissions();
permService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlNode ndPermissions = permService.GetPermissionCollection("List_Name","List");

MessageBox.Show(ndPermissions.OuterXml);

See Also

Reference

Permissions Class

Permissions Members

Permissions Web Service