<?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: Get authorized group from Document API Python in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/get-authorized-group-from-document-api-python/m-p/323242#M10243</link>
    <description>&lt;P&gt;Here is the way, if you want to do this, you need to use fetch_acls()&lt;/P&gt;
&lt;P&gt;I will comment again this post after i've done my solution that return a list of boolean &amp;amp; document (to see which document the user can consult / edit)&lt;/P&gt;
&lt;P&gt;I'm doing a third part app and i don't want the user to connect directly to Nuxeo server, that's why.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-python"&gt;    thisisadocument = nuxeo.documents.get(path='this/is/a/path')
    permissions = thisisadocument.fetch_acls()[0]["aces"]
    for permission in permissions:
        print(permission['username'])
        print(permission['permission'])
        print(permission['granted'])
        print("----------")

    user = nuxeo.users.get('thisisausername')
    for group in user.extendedGroups:
        print(group)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;resulting in :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;testuser
Read
True
----------
Administrator
Everything
True
----------
administrators
Everything
True
----------
Everyone
Everything
False
----------
{'name': 'test2', 'label': '', 'url': 'group/test2'}
{'name': 'testuser', 'label': 'usr', 'url': 'group/testuser'}

Process finished with exit code 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Feb 2021 13:59:23 GMT</pubDate>
    <dc:creator>De_Grossi_Hugo</dc:creator>
    <dc:date>2021-02-01T13:59:23Z</dc:date>
    <item>
      <title>Get authorized group from Document API Python</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/get-authorized-group-from-document-api-python/m-p/323241#M10242</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to know if we can get the groups authorized to edit / see a document using the Nuxeo Python API with Nuxeo 10.10.
I know how to find groups &amp;amp; their users, how to extract each metadata from a Document, but the groups doesn't appear in it.&lt;/P&gt;
&lt;P&gt;Edit : Apparently this should be the way : # Operation Context.GetUsersGroupIdsWithPermissionOnDoc (Get Users and Groups)
but i can't find how to use it (request)&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Hugo&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 08:27:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/get-authorized-group-from-document-api-python/m-p/323241#M10242</guid>
      <dc:creator>De_Grossi_Hugo</dc:creator>
      <dc:date>2021-01-29T08:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get authorized group from Document API Python</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/get-authorized-group-from-document-api-python/m-p/323242#M10243</link>
      <description>&lt;P&gt;Here is the way, if you want to do this, you need to use fetch_acls()&lt;/P&gt;
&lt;P&gt;I will comment again this post after i've done my solution that return a list of boolean &amp;amp; document (to see which document the user can consult / edit)&lt;/P&gt;
&lt;P&gt;I'm doing a third part app and i don't want the user to connect directly to Nuxeo server, that's why.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-python"&gt;    thisisadocument = nuxeo.documents.get(path='this/is/a/path')
    permissions = thisisadocument.fetch_acls()[0]["aces"]
    for permission in permissions:
        print(permission['username'])
        print(permission['permission'])
        print(permission['granted'])
        print("----------")

    user = nuxeo.users.get('thisisausername')
    for group in user.extendedGroups:
        print(group)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;resulting in :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;testuser
Read
True
----------
Administrator
Everything
True
----------
administrators
Everything
True
----------
Everyone
Everything
False
----------
{'name': 'test2', 'label': '', 'url': 'group/test2'}
{'name': 'testuser', 'label': 'usr', 'url': 'group/testuser'}

Process finished with exit code 0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Feb 2021 13:59:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/get-authorized-group-from-document-api-python/m-p/323242#M10243</guid>
      <dc:creator>De_Grossi_Hugo</dc:creator>
      <dc:date>2021-02-01T13:59:23Z</dc:date>
    </item>
  </channel>
</rss>

