Examples of optJSONArray()


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

    for (int i=0; i < grantedArray.length(); i++) {
      grantedPrivilegeNames.add(grantedArray.getString(i));
    }
    H.assertPrivilege(grantedPrivilegeNames,true,"jcr:all");

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNull(deniedArray);
  }

  /**
   * Test for SLING-2600, Effective ACL servlet returns incorrect information
View Full Code Here

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertTrue(grantedArray.length() >= 8);
    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()

    H.assertPrivilege(grantedPrivilegeNames,false,"jcr:addChildNodes");
    H.assertPrivilege(grantedPrivilegeNames,false,"jcr:removeNode");
    H.assertPrivilege(grantedPrivilegeNames,false,"jcr:removeChildNodes");
   
   
    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
    Set<String> deniedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < deniedArray.length(); i++) {
      deniedPrivilegeNames.add(deniedArray.getString(i));
View Full Code Here

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertTrue(grantedArray.length() >= 11);
    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()

    H.assertPrivilege(grantedPrivilegeNames,true,"jcr:lifecycleManagement");
    H.assertPrivilege(grantedPrivilegeNames,true,"jcr:modifyProperties");
    H.assertPrivilege(grantedPrivilegeNames,true,"jcr:addChildNodes");
    H.assertPrivilege(grantedPrivilegeNames,true,"jcr:removeChildNodes");

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

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNull(grantedArray);
   
    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
View Full Code Here

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

    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNull(grantedArray);
   
    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
    Set<String> deniedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < deniedArray.length(); i++) {
      deniedPrivilegeNames.add(deniedArray.getString(i));
View Full Code Here

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNull(grantedArray);
   
    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
View Full Code Here

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

    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNull(grantedArray);
   
    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
    Set<String> deniedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < deniedArray.length(); i++) {
      deniedPrivilegeNames.add(deniedArray.getString(i));
View Full Code Here

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

    assertEquals(testUserId, principalString);

          int order = aceObject.optInt("order");
          assertEquals(0, order);

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

    JSONArray deniedArray = aceObject.optJSONArray("denied");
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.