Examples of SubjectNode


Examples of org.apache.slide.structure.SubjectNode

            }
           
            // create new VR node
            String vrUriNew = vhrUri+"/"+vrNrdNew.getRevisionNumber().toString();
            UriHandler vrUhNew = UriHandler.getUriHandler( vrUriNew );
            SubjectNode vrNodeNew = new SubjectNode();
            structure.create( sToken, vrNodeNew, vrUriNew );
           
            // set specific properties
            if( keepCheckedOut ) {
                rNrd.setProperty(
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

        return hasRole(token, (SubjectNode)getPrincipal(token), role);
    }
   
    // overwrites super
    public boolean hasRole(SlideToken token, SubjectNode subjectNode, String role) throws ServiceAccessException, ObjectNotFoundException {
        SubjectNode roleNode = null;
        if (namespaceConfig.getRolesPath() != null && namespaceConfig.getRolesPath().length() != 0) {
            roleNode = SubjectNode.getSubjectNode(namespaceConfig.getRolesPath()+"/"+role);
        }
        if (roleNode != null && matchPrincipal(token, subjectNode, roleNode)) {
            return true;
        }
        else {
            // check groups
            SubjectNode groupNode = null;
            if (namespaceConfig.getGroupsPath() != null && namespaceConfig.getGroupsPath().length() != 0) {
                groupNode = SubjectNode.getSubjectNode(namespaceConfig.getGroupsPath()+"/"+role);
            }
            return (groupNode != null && matchPrincipal(token, subjectNode, groupNode));
        }
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

    /**
     * Evaluates speified ACL by first-match principle
     */
    private boolean evaluateAcl(SlideToken token, ObjectNode objectNode, ActionNode actionNode, Enumeration permissions) throws ServiceAccessException, ObjectNotFoundException {
        boolean result = false;
        SubjectNode subjectNode = (SubjectNode)getPrincipal(token);
        while (permissions.hasMoreElements()) {
            NodePermission permission = (NodePermission)permissions.nextElement();
            if (match(token, objectNode, subjectNode, actionNode, permission)) {
                result = !permission.isNegative();
                break;
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

            NodeRevisionDescriptor nrd =
                objectUri.getStore().retrieveRevisionDescriptor(objectUri, new NodeRevisionNumber());
            NodeProperty ownerProp = nrd.getProperty("owner");
            if (ownerProp != null && ownerProp.getValue() != null) {
                String usersPath = namespace.getConfig().getUsersPath();
                SubjectNode ownerSubject = SubjectNode.getSubjectNode(usersPath+"/"+ownerProp.getValue());
                return ownerSubject.equals(checkSubject);
            }
            else {
                return false;
            }
        }
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

     *
     * @throws   SlideException
     * @throws   IOException
     */
    public void execute(String resourcePath, Element multistatusElm, int depth) throws SlideException, IOException {
        SubjectNode currentUserNode = (SubjectNode)security.getPrincipal(slideToken);
        Element queryElm = getQueryElement(resourcePath, currentUserNode);
        new XMLOutputter("  ", true).output(queryElm, System.out);
       
        String absUri = WebdavUtils.getAbsolutePath (resourcePath, contextPath,
                                                     servletPath, config);
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

            }
        }
    }
   
    public void makeCollection() throws SourceException {
        SubjectNode collection = new SubjectNode();
        NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor(0);

        descriptor.setResourceType("<collection/>");
        descriptor.setCreationDate(new Date());
        descriptor.setLastModified(new Date());
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

                }

            } catch (ObjectNotFoundException e) {
               
                // Todo : Check to see if parent exists
                SubjectNode subject = new SubjectNode();

                try {
                    // Creating an object
                    m_structure.create(m_slideToken,subject,m_uri);
                } catch (SlideException se) {
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

       
        try {
           
            nat.begin();
           
            ObjectNode user = new SubjectNode();
            structure.create(slideToken,user,userUri);
           
            // create the user descriptor
            NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor();
            descriptor.setCreationDate(new Date());
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

        Content content = nat.getContentHelper();
       
        try {
            nat.begin();
           
            ObjectNode group = new SubjectNode();
            structure.create(slideToken,group,groupUri);
           
            NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor();
            descriptor.setCreationDate(new Date());
            descriptor.setLastModified(new Date());
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

        Content content = nat.getContentHelper();
       
        try {
            nat.begin();
           
            ObjectNode role = new SubjectNode();
            structure.create(slideToken,role,roleUri);
           
            NodeRevisionDescriptor descriptor = new NodeRevisionDescriptor();
            descriptor.setCreationDate(new Date());
            descriptor.setLastModified(new Date());
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.