Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.SessionImpl.checkPermission()


            Node node = session.getNodeByUUID( content.getId() );
           
            AbstractContentImpl abstractContent = (AbstractContentImpl) content;
            SessionImpl jackrabbitSession = (SessionImpl) node.getSession();
            try {
                jackrabbitSession.checkPermission(node.getPath(), SessionImpl.ADD_NODE_ACTION);
                abstractContent.setModifiable(true);
            } catch (AccessControlException ace) {
                abstractContent.setModifiable(false);
            }
            try {
View Full Code Here


                abstractContent.setModifiable(true);
            } catch (AccessControlException ace) {
                abstractContent.setModifiable(false);
            }
            try {
                jackrabbitSession.checkPermission(node.getPath(), SessionImpl.REMOVE_ACTION);
                abstractContent.setRemoveable(true);
            } catch (AccessControlException ace) {
                abstractContent.setRemoveable(false);
            }
           
View Full Code Here

            } catch (AccessControlException ace) {
                abstractContent.setRemoveable(false);
            }
           
            try {
                jackrabbitSession.checkPermission(node.getPath() + "/" + NodesTypes.PREFIX + OWNER_USERS_PROPERTY, SessionImpl.SET_PROPERTY_ACTION);
                abstractContent.setOwner(true);
            } catch (AccessControlException ace) {
                abstractContent.setOwner(false);
            }
           
View Full Code Here

        /* make sure the same privileges/permissions are granted as at path. */
        String childPath = n.getPath();
        Privilege[] privs = testAcMgr.getPrivileges(childPath);
        assertTrue(PrivilegeRegistry.READ == PrivilegeRegistry.getBits(privs));
        testSession.checkPermission(childPath, SessionImpl.READ_ACTION);
    }

    public void testNonExistingItem() throws RepositoryException, NotExecutableException {
        SessionImpl testSession = getTestSession();
        /*
 
View Full Code Here

          precondition:
          testuser must have READ-only permission on the root node and below
        */
        String rootPath = getTestSession().getRootNode().getPath();
        checkReadOnly(rootPath);
        testSession.checkPermission(rootPath + "nonExistingItem", SessionImpl.READ_ACTION);
    }

    public void testACItemsAreProtected() throws NotExecutableException, RepositoryException {
        // search for a rep:policy node
        Node policyNode = findPolicyNode(superuser.getRootNode());
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.