Package javax.jcr

Examples of javax.jcr.Session.checkPermission()


      {
         anonimSession.checkPermission(testNode.getPath(), PermissionType.READ);
         anonimSession.getRootNode().getNode("." + testNode.getPath());
         anonimSession.checkPermission(testNode.getPath(), PermissionType.SET_PROPERTY);
         anonimSession.checkPermission(testNode.getPath(), PermissionType.REMOVE);
         anonimSession.checkPermission(testNode.getPath(), PermissionType.ADD_NODE);
         fail();
      }
      catch (AccessControlException e)
      {
View Full Code Here


      }

      try
      {
         anonimSession.checkPermission(testNode.getPath(), PermissionType.READ + "," + PermissionType.ADD_NODE);
         fail();
      }
      catch (AccessControlException e)
      {
View Full Code Here

      {

      }
      try
      {
         anonimSession.checkPermission(testNode.getPath(), PermissionType.CHANGE_PERMISSION);
         fail();
      }
      catch (AccessControlException e)
      {
View Full Code Here

          testuser must have READ-only permission on the root node and below
        */
        Session testSession = getTestSession();
        String rootPath = testSession.getRootNode().getPath();
        checkReadOnly(rootPath);
        testSession.checkPermission(rootPath + "nonExistingItem", org.apache.jackrabbit.api.jsr283.Session.ACTION_READ);
    }

    public void testACItemsAreProtected() throws NotExecutableException, RepositoryException {
        // search for a rep:policy node
        Node policyNode = findPolicyNode(superuser.getRootNode());
View Full Code Here

     * instead of AccessControlException
     */
    public void testCheckAddNodePermissionOnRoot() throws RepositoryException {
        Session session = helper.getReadOnlySession();
        try {
            session.checkPermission("/", "add_node");
        } catch (PathNotFoundException e) {
            fail("JCR-1731: Session.checkPermission(\"/\", \"add_node\")"
                    + " throws PathNotFoundException instead of"
                    + " AccessControlException");
        } 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.