Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
DEVEXP-546: Scaffold new roles using privileges instead of OOTB roles
Browse files Browse the repository at this point in the history
  • Loading branch information
BillFarber committed Aug 29, 2023
1 parent 1c3e5f3 commit 4119b25
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ protected ObjectNode buildReaderRole(String appName) {
node.put("role-name", appName + "-reader");
node.put("description", "Can view documents, but not edit");
ArrayNode array = node.putArray("role");
array.add("rest-reader");
array.add(appName + "-nobody");
array = node.putArray("privilege");
array.add(buildPrivilege("rest-reader", "http://marklogic.com/xdmp/privileges/rest-reader", "execute"));
return node;
}

Expand All @@ -149,9 +150,9 @@ protected ObjectNode buildWriterRole(String appName) {
node.put("role-name", appName + "-writer");
node.put("description", "Can read and write documents");
ArrayNode array = node.putArray("role");
array.add("rest-writer");
array.add(appName + "-reader");
array = node.putArray("privilege");
array.add(buildPrivilege("rest-writer", "http://marklogic.com/xdmp/privileges/rest-writer", "execute"));
array.add(buildPrivilege("any-uri", "http://marklogic.com/xdmp/privileges/any-uri", "execute"));
array.add(buildPrivilege("unprotected-collections", "http://marklogic.com/xdmp/privileges/unprotected-collections", "execute"));
return node;
Expand Down

0 comments on commit 4119b25

Please sign in to comment.