Examples of optJSONArray()


Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

      grantedPrivilegeNames2.add(grantedArray2.getString(i));
    }
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:read");
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:modifyProperties");

    JSONArray deniedArray2 = aceObject2.optJSONArray("denied");
    assertNotNull(deniedArray2);
    assertEquals(3, deniedArray2.length());
    Set<String> deniedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < deniedArray2.length(); i++) {
      deniedPrivilegeNames2.add(deniedArray2.getString(i));
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    JSONObject aceObject2 = jsonObject2.optJSONObject(testUserId);
    assertNotNull(aceObject2);
   
    assertEquals(testUserId, aceObject.optString("principal"));
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(1, grantedArray2.length());
    Set<String> grantedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < grantedArray2.length(); i++) {
      grantedPrivilegeNames2.add(grantedArray2.getString(i));
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    for (int i=0; i < grantedArray2.length(); i++) {
      grantedPrivilegeNames2.add(grantedArray2.getString(i));
    }
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:read");

    JSONArray deniedArray2 = aceObject2.optJSONArray("denied");
    assertNotNull(deniedArray2);
    assertEquals(1, deniedArray2.length());
    Set<String> deniedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < deniedArray2.length(); i++) {
      deniedPrivilegeNames2.add(deniedArray2.getString(i));
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    assertEquals(testUserId, aceObject.optString("principal"));
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    Set<String> grantedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < grantedArray.length(); i++) {
      grantedPrivilegeNames.add(grantedArray.getString(i));
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    JSONObject aceObject2 = jsonObject2.optJSONObject(testUserId);
    assertNotNull(aceObject2);
   
    assertEquals(testUserId, aceObject2.optString("principal"));
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(1, grantedArray2.length());
    Set<String> grantedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < grantedArray2.length(); i++) {
      grantedPrivilegeNames2.add(grantedArray2.getString(i));
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    for (int i=0; i < grantedArray2.length(); i++) {
      grantedPrivilegeNames2.add(grantedArray2.getString(i));
    }
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:write");

    JSONArray deniedArray2 = aceObject2.optJSONArray("denied");
    assertNotNull(deniedArray2);
    assertEquals(1, deniedArray2.length());
    Set<String> deniedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < deniedArray2.length(); i++) {
      deniedPrivilegeNames2.add(deniedArray2.getString(i));
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    H.assertPrivilege(grantedPrivilegeNames, true, "jcr:modifyAccessControl");
    H.assertPrivilege(grantedPrivilegeNames, true, "rep:write"); //jcr:nodeTypeManagement + jcr:write
        assertEquals("Expecting the correct number of privileges in " + grantedPrivilegeNames, 4, grantedPrivilegeNames.size());

    //should be nothing left in the denied set.
    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNull(deniedArray);
  }
 
}
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

    assertEquals(0, aceObject.getInt("order"));

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals("jcr:read", grantedArray.getString(0));

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals("jcr:read", grantedArray.getString(0));

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals("jcr:write", deniedArray.getString(0));

    if (addGroupAce) {
      aceObject = jsonObject.optJSONObject(testGroupId);
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optJSONArray()

      principalString = aceObject.optString("principal");
      assertEquals(testGroupId, principalString);

            assertEquals(1, aceObject.getInt("order"));

      grantedArray = aceObject.optJSONArray("granted");
      assertNotNull(grantedArray);
      assertEquals("jcr:read", grantedArray.getString(0));
    }
   
    return testFolderUrl;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.