Ah - okay, yes this is the new Client Object model available from 
JavaScript/Silerlight/.NET is a much more pleasant way to deal with the 
SharePoint webservices.  Keep in mind the authentication schemes vary slightly 
on the new webservices vs. 2007 (with 2010 using claims-based auth) so you may 
find writing individual handlers for each is the best approach.

Although not documented by Microsoft there are some examples of using the 2007 
web services floating around that might help:

ws_Permissions.Permissions ws = newws_Permissions.Permissions();
NetworkCredential nc = newNetworkCredential(sUserName, sPassword, sDomain);
ws.Credentials = nc;
ws.Url = sOneSubSite +@"/_vti_bin/permissions.asmx";
int iMask = 0x00000001;
ws.AddPermission("Shared Documents","List", "Manager", "role", iMask);
int iMask2 =0x00000001|0x00000002|0x00000004|0x00000008;
ws.UpdatePermission("Shared Documents","List", "Manager", "role", iMask2);


(from 
http://aspalliance.com/791_Using_SharePoint_Web_Services_to_Change_Subsite_Permissions.all)

Cheers,
                J.


From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of 
Joseph Clark
Sent: Friday, 17 December 2010 12:50 PM
To: ozMOSS
Subject: Re: Updating list item permissions via SharePoint Web Services

Ah, that's the new client model in SP2010? It looks awesome! I have to support 
both SP2010 and MOSS/WSS3 unfortunately :(

On Fri, Dec 17, 2010 at 1:01 PM, James Boman 
<james.bo...@i-pmo.com.au<mailto:james.bo...@i-pmo.com.au>> wrote:
Joseph,
                You should probably use Microsoft.SharePoint.Client and not use 
the webservices directly.

See here: http://msdn.microsoft.com/en-us/library/ee535228.aspx

using System;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointServices.Samples
{
    class BreakSecurityInheritance
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";;
            ClientContext oContext = new ClientContext(siteUrl);
            SP.List oList = oContext.Web.Lists.GetByTitle("Announcements");

            oList.BreakRoleInheritance(true, false);

            oContext.ExecuteQuery();
        }
    }
}

Cheers,
                James

From: ozmoss-boun...@ozmoss.com<mailto:ozmoss-boun...@ozmoss.com> 
[mailto:ozmoss-boun...@ozmoss.com<mailto:ozmoss-boun...@ozmoss.com>] On Behalf 
Of Joseph Clark
Sent: Friday, 17 December 2010 11:49 AM
To: ozMOSS
Subject: Updating list item permissions via SharePoint Web Services

Howdy all,

I'm trying to write some code that updates permissions on a List/document 
library in SharePoint. I can see there is a Permissions 
<http://msdn.microsoft.com/en-us/library/permissions.permissions_methods%28v=office.12%29.aspx>
 web service for performing this kind of work, but there doesn't appear to be 
anything exposed by this interface for changing the permissions on individual 
items in a list (ie. the usual SPListItem.BreakRoleInheritance stuff).

Does anyone know if this is possible using the out-of-the-box web services? Or 
will I have to deploy my own web service for this purpose?

Cheers,
Joe.

_______________________________________________
ozmoss mailing list
ozmoss@ozmoss.com<mailto:ozmoss@ozmoss.com>
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

_______________________________________________
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to