Skip to content

Instantly share code, notes, and snippets.

@dixonsiu
Last active February 27, 2019 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dixonsiu/f1d344bbbbaa3839f1bb183d9eec8db4 to your computer and use it in GitHub Desktop.
Save dixonsiu/f1d344bbbbaa3839f1bb183d9eec8db4 to your computer and use it in GitHub Desktop.

セルのACL設定の確認

下記のコマンドを実行して、セルのACL設定を確認する。
コマンド:
curl "セルURL" -X PROPFIND -i -H "Depth:0" -H "Authorization: Bearer UnitAdminトークン"

コマンド例:
curl "https://sawami.demo.personium.io/" -X PROPFIND -i -H "Depth:0" -H "Authorization: Bearer sdxDsdfs"

出力結果例:

<multistatus xmlns="DAV:">
    <response>
        <href>https://sawami.demo.personium.io</href>
        <propstat>
            <prop>
                <creationdate>2017-11-22T00:01:09.340+0000</creationdate>
                <getlastmodified>Thu, 21 Feb 2019 09:19:47 GMT</getlastmodified>
                <resourcetype>
                    <collection/>
                </resourcetype>
                <p:cellstatus xmlns:p="urn:x-personium:xmlns">normal</p:cellstatus>
                <acl p:requireSchemaAuthz="public" xml:base="https://sawami.demo.personium.io/__role/__/" xmlns:p="urn:x-personium:xmlns">
                    <ace>
                        <principal>
                            <href>admin</href>
                        </principal>
                        <grant>
                            <privilege>
                                <root xmlns="" xmlns:ns3="DAV:"/>
                            </privilege>
                        </grant>
                    </ace>
                </acl>
            </prop>
            <status>HTTP/1.1 200 OK</status>
        </propstat>
    </response>
</multistatus>

セルのACLの設定

下記のコマンドを実行して、セルのACLを設定します。
コマンド:
curl "セルURL" -X ACL -i -H "Authorization: Bearer UnitAdminトークン" -d "ACL設定"

コマンド例:

curl "https://sawami.demo.personium.io/" -X ACL -i -H "Authorization: Bearer sdxDsdfs" -d '\
<?xml version="1.0" encoding="utf-8" ?> \
<D:acl xmlns:D="DAV:" xmlns:p="urn:x-personium:xmlns" xml:base="https://sawami.demo.personium.io/__role/__/"> \
  <D:ace> \
    <D:principal> \
      <D:href>admin</D:href> \
    </D:principal> \
    <D:grant> \
      <D:privilege> \
        <p:root/> \
      </D:privilege> \
    </D:grant> \
  </D:ace> \
</D:acl> \
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment