<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [NUXEO IDE] impossible to change user's group without restarting the server in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316609#M3610</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to add a user to a nuxeo group with an automation operation write in IDE.&lt;/P&gt;
&lt;P&gt;I try to do that with :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    String groupName="group";
    String user="userlogin";
    NuxeoGroup group = usermanager.getGroup(groupName);
    NuxeoPrincipal up=usermanager.getPrincipal(user); 
    List&amp;lt;String&amp;gt; userGroups = up.getGroups();
    userGroups.add(group.getName());
    up.setGroups(userGroups);
    //this part don't works
    usermanager.updatePrincipal(up);

    //same problem don't update
    DocumentModel userModel = userManager.getUserModel(user);
    userModel.setProperty("user", "groups", userGroups);
    userManager.updateUser(userModel);

    //this part works
    group.getMemberUsers().add(user);
    usermanager.updateGroup(group);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The group's user are Ok, but the user's group information is not set while I don't restart the server.&lt;/P&gt;
&lt;P&gt;Why ? Why group is instantally set and user not?&lt;/P&gt;
&lt;P&gt;What can I do to make this work ?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;ps: try also code nuxeo &lt;A href="http://www.nuxeo.com/blog/guest-post-integrating-single-sign-sso-nuxeo-case-management/"&gt;code example&lt;/A&gt; and it failed.&lt;/P&gt;
&lt;P&gt;ps2 : my user is a ldap user&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jan 2015 14:55:43 GMT</pubDate>
    <dc:creator>milonette_</dc:creator>
    <dc:date>2015-01-16T14:55:43Z</dc:date>
    <item>
      <title>[NUXEO IDE] impossible to change user's group without restarting the server</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316609#M3610</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to add a user to a nuxeo group with an automation operation write in IDE.&lt;/P&gt;
&lt;P&gt;I try to do that with :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    String groupName="group";
    String user="userlogin";
    NuxeoGroup group = usermanager.getGroup(groupName);
    NuxeoPrincipal up=usermanager.getPrincipal(user); 
    List&amp;lt;String&amp;gt; userGroups = up.getGroups();
    userGroups.add(group.getName());
    up.setGroups(userGroups);
    //this part don't works
    usermanager.updatePrincipal(up);

    //same problem don't update
    DocumentModel userModel = userManager.getUserModel(user);
    userModel.setProperty("user", "groups", userGroups);
    userManager.updateUser(userModel);

    //this part works
    group.getMemberUsers().add(user);
    usermanager.updateGroup(group);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The group's user are Ok, but the user's group information is not set while I don't restart the server.&lt;/P&gt;
&lt;P&gt;Why ? Why group is instantally set and user not?&lt;/P&gt;
&lt;P&gt;What can I do to make this work ?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;ps: try also code nuxeo &lt;A href="http://www.nuxeo.com/blog/guest-post-integrating-single-sign-sso-nuxeo-case-management/"&gt;code example&lt;/A&gt; and it failed.&lt;/P&gt;
&lt;P&gt;ps2 : my user is a ldap user&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2015 14:55:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316609#M3610</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2015-01-16T14:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: [NUXEO IDE] impossible to change user's group without restarting the server</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316610#M3611</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2015 10:51:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316610#M3611</guid>
      <dc:creator>Vladimir_Pasqui</dc:creator>
      <dc:date>2015-01-19T10:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: [NUXEO IDE] impossible to change user's group without restarting the server</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316611#M3612</link>
      <description>&lt;P&gt;Hello Vladimir,&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2015 13:53:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nuxeo-ide-impossible-to-change-user-s-group-without-restarting/m-p/316611#M3612</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2015-01-19T13:53:58Z</dc:date>
    </item>
  </channel>
</rss>

