* @throws Exception
*/
public void testGlobRestriction3() throws Exception {
Session testSession = getTestSession();
AccessControlManager testAcMgr = getTestACManager();
ValueFactory vf = superuser.getValueFactory();
/*
precondition:
testuser must have READ-only permission on test-node and below
*/
checkReadOnly(path);
checkReadOnly(childNPath);
Node child = superuser.getNode(childNPath).addNode(nodeName3);
superuser.save();
String childchildPath = child.getPath();
Privilege[] write = privilegesFromName(PrivilegeRegistry.REP_WRITE);
Privilege[] addNode = privilegesFromName(Privilege.JCR_ADD_CHILD_NODES);
String writeActions = Session.ACTION_ADD_NODE +","+Session.ACTION_REMOVE +","+ Session.ACTION_SET_PROPERTY;
Map<String, Value> restrictions = new HashMap<String, Value>(getRestrictions(superuser, path));
// permissions defined @ path
// restriction: allows write to nodeName3 children
restrictions.put(AccessControlConstants.P_GLOB.toString(), vf.createValue("/*/"+nodeName3));
givePrivileges(path, write, restrictions);
// and grant add-node only at path (no glob restriction)
givePrivileges(path, addNode, getRestrictions(superuser, path));
assertFalse(testAcMgr.hasPrivileges(path, write));