Package javax.jcr

Examples of javax.jcr.Session.checkPermission()


          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", javax.jcr.Session.ACTION_READ);
    }

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


                break;
            }
        }

        // check that all 4 permissions are granted/denied correctly
        session.checkPermission(thePath, "read");

        try {
            session.checkPermission(thePath + "/" + nodeName1, "add_node");
            fail("add_node permission on \"" + thePath + "/" + nodeName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
View Full Code Here

        // check that all 4 permissions are granted/denied correctly
        session.checkPermission(thePath, "read");

        try {
            session.checkPermission(thePath + "/" + nodeName1, "add_node");
            fail("add_node permission on \"" + thePath + "/" + nodeName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
View Full Code Here

        } catch (AccessControlException success) {
            // ok
        }

        try {
            session.checkPermission(thePath + "/" + propertyName1, "set_property");
            fail("set_property permission on \"" + thePath + "/" + propertyName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
View Full Code Here

        } catch (AccessControlException success) {
            // ok
        }

        try {
            session.checkPermission(thePath, "remove");
            fail("remove permission on \"" + thePath + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
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", javax.jcr.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 = getHelper().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

          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", javax.jcr.Session.ACTION_READ);
    }

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

                break;
            }
        }

        // check that all 4 permissions are granted/denied correctly
        session.checkPermission(thePath, "read");

        try {
            session.checkPermission(thePath + "/" + nodeName1, "add_node");
            fail("add_node permission on \"" + thePath + "/" + nodeName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
View Full Code Here

        // check that all 4 permissions are granted/denied correctly
        session.checkPermission(thePath, "read");

        try {
            session.checkPermission(thePath + "/" + nodeName1, "add_node");
            fail("add_node permission on \"" + thePath + "/" + nodeName1 + "\" granted to read-only Session");
        } catch (AccessControlException success) {
            // ok
        }
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.