AddPermissionCollection Method

The AddPermissionCollection method of the Permissions service modifies site-level permissions for the specified collection of existing site groups, or adds or modifies permissions to the list for the specified collection of existing users, site groups, and/or cross-site groups.

Parameters

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

objectType   A string that specifies either List or Web.

permisssionsInfoXml   An XML fragment in the following format that specifies the permissions to add and that can be passed as a System.Xml.XmlNode object:

<Permissions>
   <Users>
      <User LoginName="DOMAIN\User_Alias" Email="Email_Address"
         Name="Display_Name" Notes="Notes" PermissionMask="138608641" />
         .
         .
         .
   </Users>
   <Groups>
      <Group GroupName="Cross-site_Group" PermissionMask="1027801615" />
      .
      .
      .
   </Groups>
   <Roles>
      <Role RoleName="Site_Group" PermissionMask="-1" />
      .
      .
      .
   </Roles>
</Permissions>

Example

The following code example modifies the permissions to a list for the specified collection of existing users, site groups, and cross-site groups. The example assumes the existence of a local XML file that contains information about the users and groups, which is loaded into a System.Xml.XmlDocument object.

This example requires that a using (C#) or Imports (Visual Basic .NET) directive be included for the System.Xml namespace.

Requirements

Platforms: Microsoft Windows Server 2003

Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Permissions.asmx