MOSS Forum

 
Home » Forum » MOSS       Ask a questionRSS Feeds

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

  Asked By: Karen Coleman         Date: Jun 24, 2006      Category: MOSS      Views: 686
 

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()

{

try

{

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>" +

"</Permissions>";

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, 2006       

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

 


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].