Package javax.jcr

Examples of javax.jcr.Session.checkPermission()


      Session session1 = repository.login(new CredentialsImpl("john", "exo".toCharArray()));
      session1.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.READ);
      try
      {
         session1.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
      catch (AccessControlException e)
      {
      }
View Full Code Here


      // check permission for exo2 - nothing allowed
      Session session2 = repository.login(new CredentialsImpl("mary", "exo".toCharArray()));
      try
      {
         session2.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.READ);
         fail("AccessControlException should have been thrown ");
      }
      catch (AccessControlException e)
      {
      }
View Full Code Here

      assertTrue(nodeToLockSession1.isLocked());
      nodeToLockSession1.unlock();
      assertFalse(nodeToLockSession1.isLocked());

      Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
      session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
      try
      {
         session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
View Full Code Here

      Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
      session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
      try
      {
         session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
      catch (AccessControlException e)
      {
         //ok
View Full Code Here

      assertTrue(nodeToLockSession1.isLocked());
      nodeToLockSession1.unlock();
      assertFalse(nodeToLockSession1.isLocked());

      Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
      session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
      try
      {
         session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
View Full Code Here

      Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
      session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
      try
      {
         session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
      catch (AccessControlException e)
      {
         //ok
View Full Code Here

      Lock lock = nodeToLockSession1.lock(true, 100000);
      assertTrue(nodeToLockSession1.isLocked());

      Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
      session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
      try
      {
         session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
View Full Code Here

      Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
      session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
      try
      {
         session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
      catch (AccessControlException e)
      {
         //ok
View Full Code Here

      // ACL is:
      // Owner = exo
      // ADD_NODE and READ permissions for john
      // check permission for john - ADD_NODE and READ allowed
      Session session1 = repository.login(new CredentialsImpl("john", "exo".toCharArray()));
      session1.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.READ);
      try
      {
         session1.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
View Full Code Here

      // check permission for john - ADD_NODE and READ allowed
      Session session1 = repository.login(new CredentialsImpl("john", "exo".toCharArray()));
      session1.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.READ);
      try
      {
         session1.checkPermission("/accessTestRoot/testSessionCheckPermission", PermissionType.SET_PROPERTY);
         fail("AccessControlException should have been thrown ");
      }
      catch (AccessControlException e)
      {
      }
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.