This project is read-only.

Grant permission on list item with mulitple people selection column


First of all thank you all for this very useful project. There is an error when I try to grant permission on a people column with multiple selection of people. Is there a way to do this?


octane165 wrote Nov 14, 2008 at 11:11 AM

Thanks for this huge work done. I also need to be able to grant permission to a group of users listed in a single field (that allows multiple selection).
Any help would be very appreciated.

wrote Nov 16, 2008 at 8:23 PM

octane165 wrote Jan 29, 2009 at 5:34 PM

Here is a piece of code, to add in common.cs, that answers the request (it works fine for me). I hope it will be implemented in the next version:

// Loop for users listed in Username
                foreach (string stCurUser in UserName.Split(new char[] { ';' }))
                    PermissionRequest myGrantRequest = new PermissionRequest();

                    myGrantRequest.RequestType = PermissionActionType.Grant;
                    myGrantRequest.ItemId = ListItem;
                    myGrantRequest.ListID = new Guid(ListId);
                    myGrantRequest.SiteID = __Context.Site.ID;
                    myGrantRequest.WebID = __Context.Web.ID;
                    myGrantRequest.User = stCurUser.Trim();
                    myGrantRequest.PermissionLevel = Common.ProcessStringField(executionContext, PermissionLevel);

                    WorkflowEnvironment.WorkBatch.Add(PermissionsService.Instance, myGrantRequest);


hasina wrote Sep 15, 2009 at 11:18 AM

Hi octane165

I also need to grant permission to multiple users. Thanks for posting the code that you used to achieve this. I would really appreciate it if you could you please guide me on how to use the code since i am not a developer. Looking forward to hearing from you.


wrote Sep 15, 2009 at 11:21 AM

hstaples wrote Nov 13, 2009 at 9:55 PM

@octane165, Thanks, I got your code to work. But I didn't update common.cs. Instead, I pulled down the PROD codebase and modified AddListItemPermissionAssignment.cs, and inserted your code on line 144 to replace the existing set of instructions for adding the single permission.

I've only been able to figure out half the build process with this project ... it wasn't compiling in Release mode and then WSPBuilder was barfing. So after I removed some build settings on the "Release" that were causing errors for me, I was able to build out the DLL, and then cabarc that into an existing .wsp, and then run setup.exe to add the feature to Sharepoint. Once I figure out why WSPBuilder is not liking the build process for this project, then I'll be set.

wrote Nov 20, 2009 at 12:26 PM

hoopdeetoo wrote Feb 24, 2011 at 2:58 AM

Does anyone have this packaged as wsp and could provide a link to download it for us non-devs? It would be much appreciated.

wrote Feb 22, 2013 at 1:36 AM

sandernelen wrote Sep 10, 2013 at 2:45 PM

Can someone provide an updated wsp? I can't seem to edit the sln using VS2012.
Like hoopdeetoo said, it would be much appreciated...

sandernelen wrote Sep 10, 2013 at 2:48 PM

Can someone provide an updated wsp? I can't seem to edit the sln using VS2012.
Like hoopdeetoo said, it would be much appreciated...