<?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 Re: Problems with the class UnrestrictedSessionRunner in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314842#M1843</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jul 2014 11:25:58 GMT</pubDate>
    <dc:creator>Vladimir_Pasqui</dc:creator>
    <dc:date>2014-07-08T11:25:58Z</dc:date>
    <item>
      <title>Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314839#M1840</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm using the UnrestrictedSessionRunner class to try to WRITE_SECURITY permission before saving a Document(Task) to a user who is not in the Admin group , the runUnrestricted () method returns a new session without the information we need to grant permission.
Here's an example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;protected class WritePermission extends UnrestrictedSessionRunner {

    protected WritePermission(CoreSession session) {
        super(session);
        // this.session = documentManager;
    }

    @Override
    public void run() throws ClientException {

        DocumentModel doc = getCurrentDocument();
        ACP acp = null;
        DocumentModel doc2 = session.getDocument(new PathRef(
                doc.getPath().toString()));
        try {
            acp = doc2.getACP();
        } catch (Exception e) {

        }

        if (acp == null) {
            acp = new ACPImpl();
        }
        ACL acl = acp.getOrCreateACL();
        int WorkspaceAdminACEIndex = acl.indexOf(new ACE(
                session.getPrincipal().toString(),
                SecurityConstants.WRITE_SECURITY, true));
        if (WorkspaceAdminACEIndex == -1) {
            ACE ace = new ACE(session.getPrincipal().toString(),
                    SecurityConstants.WRITE_SECURITY, true);
            acl.add(0, ace);
            acp.addACL(acl);
            doc2.setACP(acp, true);
        }
        session.saveDocument(doc2);
        session.save();
    }
}

new WritePermission(documentManager).runUnrestricted(); // calling the runUnrestricted method.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How could grant permission to the user in this new session returned by runUnrestricted () method?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 21:54:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314839#M1840</guid>
      <dc:creator>klebervz_</dc:creator>
      <dc:date>2014-06-30T21:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314840#M1841</link>
      <description>&lt;P&gt;I don't understand the problem you have.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 12:36:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314840#M1841</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2014-07-02T12:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314841#M1842</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2014 16:55:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314841#M1842</guid>
      <dc:creator>klebervz_</dc:creator>
      <dc:date>2014-07-02T16:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314842#M1843</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2014 11:25:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314842#M1843</guid>
      <dc:creator>Vladimir_Pasqui</dc:creator>
      <dc:date>2014-07-08T11:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314843#M1844</link>
      <description>&lt;P&gt;Hi Vladimir and Florent&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2014 15:09:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314843#M1844</guid>
      <dc:creator>SergioFerreira_</dc:creator>
      <dc:date>2014-07-08T15:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314844#M1845</link>
      <description>&lt;P&gt;This was just fixed and will be available in the next 5.8 hotfix (&lt;A href="https://jira.nuxeo.com/browse/NXP-14939"&gt;NXP-14939&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 14:36:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314844#M1845</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2014-08-13T14:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with the class UnrestrictedSessionRunner</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314845#M1846</link>
      <description>&lt;P&gt;Hi, Thank You&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 14:48:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/problems-with-the-class-unrestrictedsessionrunner/m-p/314845#M1846</guid>
      <dc:creator>klebervz_</dc:creator>
      <dc:date>2014-08-13T14:48:36Z</dc:date>
    </item>
  </channel>
</rss>

