6
Vote

Grant permission on list item with mulitple people selection column

description

Hi,
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?

comments

octane165 wrote Nov 14, 2008 at 10: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 7:23 PM

octane165 wrote Jan 29, 2009 at 4:34 PM

Hi,
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 10: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.

Regards,
Hasina

wrote Sep 15, 2009 at 10:21 AM

hstaples wrote Nov 13, 2009 at 8: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 11:26 AM

hoopdeetoo wrote Feb 24, 2011 at 1: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 12:36 AM

sandernelen wrote Sep 10, 2013 at 1: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 1: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...