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...