Package org.exoplatform.services.jcr.core

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


    *  Unit test for https://jira.exoplatform.org/browse/JCR-1832
    */
   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());
View Full Code Here


     
      Session sessJohn = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
     
      ExtendedNode folderB = (ExtendedNode)sessJohn.getRootNode().getNode("folderA").addNode("folderB", "nt:folder");
     
      folderB.addMixin("exo:privilegeable");
      folderB.setPermission("any", new String[]{"read"});
      sessJohn.save();
     
      assertEquals(5, folderB.getACL().getPermissionEntries().size());
      assertEquals("john read", folderB.getACL().getPermissionEntries().get(0).getAsString());
View Full Code Here

   public void testModifyAndReadItem() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testModifyAndReadNode");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      HashMap<String, String[]> perm = new HashMap<String, String[]>();
      perm.put("john", PermissionType.ALL);
      perm.put("mary", new String[]{PermissionType.READ});
View Full Code Here

   public void testModifyAndReadItem() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testModifyAndReadNode");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      HashMap<String, String[]> perm = new HashMap<String, String[]>();
      perm.put("john", PermissionType.ALL);
      perm.put("mary", new String[]{PermissionType.READ});
      node.setPermissions(perm);
View Full Code Here

   public void testCheckAndCleanPermissions() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testCheckAndCleanPermissions");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      HashMap<String, String[]> perm = new HashMap<String, String[]>();
      perm.put("john", PermissionType.ALL);
      perm.put("mary", new String[]{PermissionType.READ});
View Full Code Here

   public void testCheckAndCleanPermissions() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testCheckAndCleanPermissions");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      HashMap<String, String[]> perm = new HashMap<String, String[]>();
      perm.put("john", PermissionType.ALL);
      perm.put("mary", new String[]{PermissionType.READ});
      node.setPermissions(perm);
View Full Code Here

   }

   public void testAddSaveAndRead() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testSetAndRemovePermission");
      node.addMixin("exo:privilegeable");
      node.setPermission("john", PermissionType.ALL);
      String owner = node.getACL().getOwner();
      assertEquals(8, node.getACL().getPermissionEntries().size());
      accessTestRoot.save();
      Session session1 = repository.login(new CredentialsImpl("john", "exo".toCharArray()));
View Full Code Here

   public void testSetAndRemovePermission() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testSetAndRemovePermission");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      node.setPermission("john", PermissionType.ALL);
      assertEquals(PermissionType.ALL.length * 2, node.getACL().getPermissionEntries().size());

View Full Code Here

   public void testSetAndRemovePermission() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testSetAndRemovePermission");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      node.setPermission("john", PermissionType.ALL);
      assertEquals(PermissionType.ALL.length * 2, node.getACL().getPermissionEntries().size());

      // ("Access contr " +
View Full Code Here

    */
   public void testReplacePermission() throws Exception
   {
      ExtendedNode node = (ExtendedNode)accessTestRoot.addNode("testReplacePermission");
      // node.addMixin("exo:accessControllable");
      node.addMixin("exo:owneable");
      node.addMixin("exo:privilegeable");

      node.setPermission("john", PermissionType.ALL);
      assertEquals(PermissionType.ALL.length * 2, node.getACL().getPermissionEntries().size());

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.