Package org.exoplatform.services.jcr.core

Examples of org.exoplatform.services.jcr.core.ExtendedNode.removePermission()


   public void testGetFileFromFolder() throws Exception
   {
      ExtendedNode folderA = (ExtendedNode)session.getRootNode().addNode("folderA", "nt:folder");
      folderA.addMixin("exo:privilegeable");
      folderA.setPermission("john", PermissionType.ALL);
      folderA.removePermission(IdentityConstants.ANY);
      session.save();
     
      assertEquals(4, folderA.getACL().getPermissionEntries().size());
      assertEquals("john read", folderA.getACL().getPermissionEntries().get(0).getAsString());
      assertEquals("john add_node", folderA.getACL().getPermissionEntries().get(1).getAsString());
View Full Code Here


      // ("Access contr " +
      // node.isNodeType("exo:accessControllable"));
      node.setPermission("mary", new String[]{PermissionType.READ});
      assertEquals(PermissionType.ALL.length * 2 + 1, node.getACL().getPermissionEntries().size());

      node.removePermission("john");
      assertEquals(PermissionType.ALL.length + 1, node.getACL().getPermissionEntries().size());

   }

   /**
 
View Full Code Here

      // node.isNodeType("exo:accessControllable"));

      node.setPermission("john", new String[]{PermissionType.READ});
      assertEquals(PermissionType.ALL.length + 1, node.getACL().getPermissionEntries().size());

      node.removePermission("john");
      assertEquals(PermissionType.ALL.length, node.getACL().getPermissionEntries().size());
   }

   /**
    * check if the removePermission(String identity, String permission) remove
View Full Code Here

      accessTestRoot.save();

      Session session1 = repository.login(new CredentialsImpl("mary", "exo".toCharArray()));
      ExtendedNode testRemoveSpecifiedNode =
         (ExtendedNode)session1.getRootNode().getNode("accessTestRoot").getNode("testRemoveSpecified");
      testRemoveSpecifiedNode.removePermission(SystemIdentity.ANY);

      assertTrue(accessManager.hasPermission(testRemoveSpecifiedNode.getACL(), PermissionType.READ,
         new Identity("john")));

      testRemoveSpecifiedNode.removePermission("john", PermissionType.READ);
View Full Code Here

      testRemoveSpecifiedNode.removePermission(SystemIdentity.ANY);

      assertTrue(accessManager.hasPermission(testRemoveSpecifiedNode.getACL(), PermissionType.READ,
         new Identity("john")));

      testRemoveSpecifiedNode.removePermission("john", PermissionType.READ);
      assertTrue(accessManager.hasPermission(testRemoveSpecifiedNode.getACL(), PermissionType.SET_PROPERTY,
         new Identity("john")));

      assertFalse(accessManager.hasPermission(testRemoveSpecifiedNode.getACL(), PermissionType.READ, new Identity(
         "john")));
View Full Code Here

      accessTestRoot.removePermission(SystemIdentity.ANY);
      accessTestRoot.setPermission("john", new String[]{PermissionType.READ});

      ExtendedNode testByOwnerNodeSystem = (ExtendedNode)accessTestRoot.getNode("testByOwnerNode");
      testByOwnerNodeSystem.setPermission(accessTestRoot.getSession().getUserID(), PermissionType.ALL);
      testByOwnerNodeSystem.removePermission("john");
      testByOwnerNodeSystem.removePermission(SystemIdentity.ANY);
      testByOwnerNodeSystem.setPermission("john", new String[]{PermissionType.READ});

      session.save();
View Full Code Here

      accessTestRoot.setPermission("john", new String[]{PermissionType.READ});

      ExtendedNode testByOwnerNodeSystem = (ExtendedNode)accessTestRoot.getNode("testByOwnerNode");
      testByOwnerNodeSystem.setPermission(accessTestRoot.getSession().getUserID(), PermissionType.ALL);
      testByOwnerNodeSystem.removePermission("john");
      testByOwnerNodeSystem.removePermission(SystemIdentity.ANY);
      testByOwnerNodeSystem.setPermission("john", new String[]{PermissionType.READ});

      session.save();

      session1 = repository.login(new CredentialsImpl("john", "exo".toCharArray()));
View Full Code Here

      ExtendedNode testRoot = (ExtendedNode)accessTestRoot.addNode("testRemoveExoOwnable");
      testRoot.addMixin("exo:privilegeable");
      testRoot.setPermission("john", new String[]{PermissionType.READ, PermissionType.ADD_NODE,
         PermissionType.SET_PROPERTY});
      testRoot.setPermission(accessTestRoot.getSession().getUserID(), PermissionType.ALL);
      testRoot.removePermission(SystemIdentity.ANY);

      ExtendedNode subRoot = (ExtendedNode)testRoot.addNode("subroot");
      accessTestRoot.getSession().save();

      Session session1 = repository.login(new CredentialsImpl("john", "exo".toCharArray()));
View Full Code Here

      // } catch (AccessControlException e) {
      // //ok
      // }

      testNode.setPermission(testNode.getSession().getUserID(), PermissionType.ALL);
      testNode.removePermission(SystemIdentity.ANY);
      session.save();
      try
      {
         anonimSession.checkPermission("." + testNode.getPath(), PermissionType.READ);
         fail();
View Full Code Here

      }
      catch (AccessControlException e)
      {

      }
      testNode.removePermission(SystemIdentity.ANY);
      session.save();
      try
      {
         anonimSession.checkPermission("." + testNode.getPath(), PermissionType.READ);
         fail();
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.