MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Setting Permissions through webservices(permissions.asmx) MOSS-RTM

  Asked By: Karen    Date: Jun 24    Category: MOSS    Views: 2642

I am using the Sharepoint 2007 trial version.

I am trying to set the document library permissions using webservice permissions.asmx

My code is as below...

/// <summary>

/// Adds permissions to the collection of permissions for a site or list.

/// </summary>

/// <param name="objectName"></param>

/// <param name="objectType"></param>

/// <param name="xmlPermissionSet"></param>

public void SetObjectPermissionCollection()




string objectName="MyDocLib";

string objectType ="List"

Permissions spsPerm = new Permissions(contextSiteUrl);

spsPerm.Credentials = CredentialCache.DefaultNetworkCredentials;

XmlDocument permissionsDoc = new XmlDocument();

XmlElement elPermissions= permissionsDoc.CreateElement("Permissions");

elPermissions.InnerXml = "<Permissions>" +

"<Users>" +

"<User LoginName='AMR\\BGRUBB1' Email='barry.grubb@...' Name='Barry' Notes='Notes' PermissionMask='134287360' />" +

"</Users>" +


spsPerm.AddPermissionCollection(objectName, objectType, xmlPermissionSet);


catch (Exception ex)


throw ex;



This seem to be not working. I don't get any error when I run the above code, but I don't see the user the permissions changed when I navigate to document library and see the user permissions.

Need desperately some help on this...



1 Answer Found

Answer #1    Answered By: Emmett Hyde     Answered On: Jun 24

What happens when you debug the code? Have you tried calling the Web
Service from a console app?