in src/main/java/org/apache/sling/jcr/base/util/AccessControlUtil.java [299:319]
public static boolean addEntry(AccessControlList acl, Principal principal, Privilege privileges[], boolean isAllow,
Map<String, Value> restrictions, Map<String, Value[]> mvRestrictions)
throws UnsupportedRepositoryOperationException, RepositoryException {
Object[] args = null;
Class<?>[] types = null;
if (mvRestrictions == null && restrictions == null) {
//no restrictions specified
args = new Object[] {principal, privileges, isAllow};
types = new Class[] {Principal.class, Privilege[].class, boolean.class};
} else if (mvRestrictions == null) {
//only single-value restrictions (valid with jackrabbit-api version 2.0.0 or later)
args = new Object[] {principal, privileges, isAllow, restrictions};
types = new Class[] {Principal.class, Privilege[].class, boolean.class, Map.class};
} else {
//both single-value and multi-value restrictions (valid with jackrabbit-api version 2.8.0 or later)_
args = new Object[] {principal, privileges, isAllow, restrictions, mvRestrictions};
types = new Class[] {Principal.class, Privilege[].class, boolean.class, Map.class, Map.class};
}
return safeInvokeRepoMethod(acl, METHOD_JACKRABBIT_ACL_ADD_ENTRY, Boolean.class, args, types);
}