@Override protected JackrabbitAccessControlEntry createEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String, Value> restrictions) throws RepositoryException { return acl.createEntry(principal, privileges, isAllow, restrictions); }
@Override protected JackrabbitAccessControlEntry createEntry(Principal principal, Privilege[] privileges, boolean isAllow) throws RepositoryException { return acl.createEntry(principal, privileges, isAllow, Collections.<String, Value>emptyMap()); }
/** * The only known restriction is: * <pre> * rep:glob (optional) value-type: STRING * </pre> * * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlList#addEntry(Principal, Privilege[], boolean, Map) */ public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String, Value> restrictions) throws AccessControlException, RepositoryException { checkValidEntry(principal, privileges, isAllow, restrictions); Entry ace = createEntry(principal, privileges, isAllow, restrictions); return internalAdd(ace); }
/** * The only known restriction is: * <pre> * rep:glob (optional) value-type: STRING * </pre> * * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlList#addEntry(Principal, Privilege[], boolean, Map) */ public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String, Value> restrictions) throws AccessControlException, RepositoryException { checkValidEntry(principal, privileges, isAllow, restrictions); Entry ace = createEntry(principal, privileges, isAllow, restrictions); return internalAdd(ace); }
@Override protected JackrabbitAccessControlEntry createEntryFromBase(JackrabbitAccessControlEntry base, Privilege[] privileges, boolean isAllow) throws RepositoryException, NotExecutableException { if (base instanceof ACLTemplate.Entry) { return acl.createEntry((ACLTemplate.Entry) base, privileges, isAllow); } else { throw new NotExecutableException(); } }
public void testRestrictions() throws RepositoryException { // test if restrictions with expanded name are properly resolved Map<String, Value> restrictions = new HashMap<String,Value>(); restrictions.put(ACLTemplate.P_GLOB.toString(), superuser.getValueFactory().createValue("*/test")); Privilege[] privs = new Privilege[] {acMgr.privilegeFromName(Privilege.JCR_ALL)}; ACLTemplate.Entry ace = acl.createEntry(testPrincipal, privs, true, restrictions); Value v = ace.getRestriction(ACLTemplate.P_GLOB.toString()); Value v2 = ace.getRestriction(((SessionImpl) superuser).getJCRName(ACLTemplate.P_GLOB)); assertEquals(v, v2); } }