sem.graphSetPermissions( $graph as sem.iri, $permissions as Object ) as null
Set permissions to the graph specified. The user must have update permissions on the graph.
This function is a built-in.
|$graph||The graph IRI.|
Security permission objects corresponding to the permissions
for the document. If not supplied, the current user's default
permissions are applied. The default value used for $permissions
can be obtained by calling xdmp.defaultPermissions(). A document that is
created by a non-admin user (that is, by any user who does not have the
var sem = require('/MarkLogic/semantics'); sem.graphSetPermissions((sem.iri("graphs/MyDemoGraph")), ( xdmp.permission( "demo-reader", "read" ), xdmp.permission( "demo-writer", "update" ) ) )