People Picker and site permissions

  • 9 February 2010
  • 5 replies
  • 7 views

Badge

Hi,


I have a SharePoint list that manages site provisioning etc. In this list there is a "Members" field which is a multi people picker.


I'm having issues populating a custom group that is created as part of the K2 workflow (group is created fine) with the values of this colum.

Is it possible to populate a SharePoint group with the data from a multi-people picker control?


Thanks.


 


5 replies

Badge +8

is there a solutions for this issue?
I have the same situation:
- creating a site
- setting permissions on this site (based on multi peolpe picker)
- setting permissions in the site provisioning list


setting permission with a single people picker control is working fine.


Thanks!

Badge +10

Which designer are you using?


 


What happens to the permissions are any perms set?

Badge +8

I am using K2 Studio.


Within k2 designer for sharepoint there is no event to set permission on sites or list items etc. (unforteunately).


Permissions from a single pepople picker are set.
with a multi-people picker (and multiple selected within this people picker) the event throws an error.

Badge +10

It looks to me like currently that is expected behavior. That these need to be set one at a time if you are doing users.  However if you are up for some code you can


 


1.      Take a look at the value that comes out of the multiple-people picker control (I don’t recall it off the top of my head, but it is probably some sort of delimited field or potentially xml)


o   If it is repeating XML , great, take note of which element has the repeating value


o   If it is delimited, you’ll need to do a split inline function later on


2.      Put the event the updates the group permissions in its own activity


3.      On the new activity (mentioned in step above) leverage that repeating data by using Plan Per Slot No Destination


4.      Set the slots to break upon whatever field in the collection has the value (either XML of Split inline function mentioned in #1 above)


NOTE: there is some coverage on Plan Per Slot (no Destinations) here: 


http://k2underground.com/blogs/fromthebench/archive/2008/10/22/using-a-repeating-xml-node-to-start-child-ipcs.aspx


 


                                It is basically just a For-Each loop.


You may also want to open a ticket this way we can be 100% sure what you are seing is not something we can fix without going through the above code.  This also gives us the opportunity to log a feature reqeust if needed.


 


Thanks

Badge +10

To add to what Chris has said:


The People picker stores the users by delimiting them with a semi-colon and a space (; ).


If you move the add to group event into its own activity you can make use of the Plan Per Slot (No Destination) activity planning option to add each individual user to the group. For this you will use the String > Split function when configuring the Plan Per Slot configuration.



 


On your event that adds the user to the group use the trim function to get rid of the space and use the ActInstDest.InstanceData field for the value of the user to add.



The above should work for you.


Regards,

Reply