0

In eXist 4.4 I am setting a user's rwx permission in XQuery using sm:add-user-ace(). I do not see a corollary 'remove-user-ace', so I assume I have to use sm:remove-ace($path as xs:anyURI, $index as xs:int). However this requires knowing the $index. Is there function for getting the $index for a combination $user and collection/resource? (I don't see any at the eXist security fundocs)

Many thanks in advance.

jbrehr
  • 775
  • 6
  • 19

1 Answers1

1

You need to use the sm:get-permissions function on the URI of the Document or Collection. It will give you an XML document which will show all the ACL entries.

adamretter
  • 3,885
  • 2
  • 23
  • 43
  • Thanks. What path does eXist expect for xs:anyURI? If I want to check a document, such as `sm:get-permissions("/db/apps/deheresi/data/MS609-0001.xml")` I'm told that `xs:string is not a subtype of xs:anyURI`. But I also can't pass it a node... – jbrehr Jun 17 '19 at 22:50
  • Nevermind: the answer to my own question is wrapping the URI in `xs:anyURI()`. Therefore `sm:get-permissions(xs:anyURI("/db/apps/deheresi/data/MS609-0001.xml"))`. – jbrehr Jun 17 '19 at 22:54