<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Programmatically update User Roles membership</title><link>https://www.infopathdev.com:443/forums/thread/92096.aspx</link><pubDate>Sun, 11 Aug 2013 20:06:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:92096</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/92096.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=92096</wfw:commentRss><description>&lt;p&gt;Hi Josée,&lt;/p&gt;
&lt;p&gt;One first imagines you could use GetUserProfileService to get the groups and then have the form&amp;#39;s user role dialog lookup users from that, but it won&amp;#39;t work because User Roles are based on active directory and SharePoint groups are defined separately (even though they are defined based on AD groups).&amp;nbsp;In other words, even if you get them in your form they won&amp;#39;t correspond to the actual user who opens the form in the InfoPath rich client.&lt;/p&gt;
&lt;p&gt;So, I recommend removing the user role functionality from your form and using fields in your form&amp;#39;s main data source to manage them with lookups to GetUserProfileService and/or a separate list to test whether or not the current user is in a role or not. For example, you can create a User Role&amp;#39;s list that specifies role and user/group. On form load, you open this list and lookup the user and user&amp;#39;s group and&amp;nbsp;filter the list with that info to determine which roles are available.&amp;nbsp;You&amp;nbsp;will need some notion of role precedence&amp;nbsp;in the case a user has two roles (i.e. order for which one to assign).&lt;/p&gt;
&lt;p&gt;Anyway, it&amp;#39;s all very doable. Unfortunately, the User Role functionality isn&amp;#39;t very extensible these days and that&amp;#39;s ok because you can just use external data sources and form logic to achieve the same functionality and extend beyond the limits imposed by it.&amp;nbsp; The same is true for Submit Options. I tell people to not use Submit buttons but rather regular buttons configured to use Rules and Custom Code and just have the button execute rules. Much more flexible.&lt;/p&gt;
&lt;p&gt;Good luck!&amp;nbsp;&lt;/p&gt;</description></item><item><title>Programmatically update User Roles membership</title><link>https://www.infopathdev.com:443/forums/thread/91981.aspx</link><pubDate>Tue, 06 Aug 2013 23:38:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91981</guid><dc:creator>Josee Sevigny</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91981.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91981</wfw:commentRss><description>&lt;p&gt;I have a requirement where I would like to update a role&amp;#39;s membership with the people from a SharePoint group. We are using web services and code behind to fetch the users but would it be possible to then update(add) the role&amp;#39;s membership with those users? I can&amp;#39;t use AD groups and User Roles don&amp;#39;t support SharePoint groups. I also would prefer not to hard code specific users in the roles in case they change over time.&lt;/p&gt;&lt;p&gt;&lt;font color="#006600" face="courier new,courier"&gt;&amp;lt;xsf:roles default=&amp;quot;Default&amp;quot; initiator=&amp;quot;Requester&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:role name=&amp;quot;Requester&amp;quot;&amp;gt;&amp;lt;/xsf:role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:role name=&amp;quot;Approver&amp;quot;&amp;gt;&amp;lt;/xsf:role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:role name=&amp;quot;Finance&amp;quot;&amp;gt;&amp;lt;/xsf:role&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:membership&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:getUserNameFromData select=&amp;quot;/my:myFields/my:participants/my:requester/my:staff/my:login&amp;quot; memberOf=&amp;quot;Requester&amp;quot;&amp;gt;&amp;lt;/xsf:getUserNameFromData&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:getUserNameFromData select=&amp;quot;/my:myFields/my:participants/my:approvers/my:approverChoice&amp;quot; memberOf=&amp;quot;Approver&amp;quot;&amp;gt;&amp;lt;/xsf:getUserNameFromData&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/xsf:membership&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/xsf:roles&amp;gt;&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>