Skip to content

Instantly share code, notes, and snippets.

@mchrominski
Created September 27, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mchrominski/84b887223d6d35806cd2 to your computer and use it in GitHub Desktop.
Save mchrominski/84b887223d6d35806cd2 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