Skip to content

Instantly share code, notes, and snippets.

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 dfparker2002/0c5bc49af5f7f8eee114 to your computer and use it in GitHub Desktop.
Save dfparker2002/0c5bc49af5f7f8eee114 to your computer and use it in GitHub Desktop.
def applyRestriction(path, prefix) {
def acl = getAcl(path)
def restrictions = new HashMap<String, Value>()
def values = new Value[1]
values[0] = session.getValueFactory().createValue(prefix)
restrictions.put("rep:prefixes", values)
acl.addEntry(principal, privileges, false, emptyMap, restrictions)
acMgr.setPolicy(acl.getPath(), acl);
session.save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment