Package org.apache.slide.structure

Examples of org.apache.slide.structure.SubjectNode


     * @throws   ObjectNotFoundException
     * @throws   ServiceAccessException
     */
    public boolean checkLockOwner(SlideToken slideToken, NodeLock token) throws ObjectNotFoundException, ServiceAccessException {
        boolean canUnlock = true;
        SubjectNode principal = (SubjectNode)securityHelper.getPrincipal(slideToken);
        SubjectNode lockOwner = SubjectNode.getSubjectNode(token.getSubjectUri());
        if (!securityHelper.matchPrincipal(slideToken, principal, lockOwner)) {
            // it is not the lock owner ... now check the kill-lock privilege
            try {
                securityHelper.checkCredentials(slideToken,
                                                SubjectNode.getSubjectNode(token.getObjectUri()),
View Full Code Here


       
        // lock-types-are-equal
        boolean condition1 = matchToken.getTypeUri().equals(checkToken.getTypeUri());
       
        // user-of-tokens-are-equal OR user-of-matchToken-is-parent
        SubjectNode checkSubject = SubjectNode.getSubjectNode(checkToken.getSubjectUri());
        SubjectNode matchSubject = SubjectNode.getSubjectNode(matchToken.getSubjectUri());
        boolean condition2 =
            securityHelper.matchPrincipal(slideToken, checkSubject, matchSubject);
       
        // lock-types-are-equal OR lock-type-of-matchToken-is-parent
        ActionNode checkAction = ActionNode.getActionNode(checkToken.getTypeUri());
View Full Code Here

        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

    /**
     * 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

            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

                    else if (level > 0) {
                        int nextLevel = level - 1;
                        boolean match = false;
                        Iterator i = memberNodes.iterator();
                        while (!match && i.hasNext()) {
                            SubjectNode nextMatchNode = (SubjectNode)i.next();
                            if (namespaceConfig.isRole(nextMatchNode.getUri())
                                || namespaceConfig.isGroup(nextMatchNode.getUri())) {
                               
                                match = matchPrincipal(token, checkSubject, nextMatchNode, nextLevel);
                            }
                        }
                        return match;
View Full Code Here

                    if (object instanceof LinkNode) {
                        String linkedUri =
                            objectDefinition.getAttribute("linkedUri");
                        accessToken.getStructureHelper().createLink
                            (token, (LinkNode) object, uri,
                             new SubjectNode(linkedUri));
                    } else {
                        accessToken.getStructureHelper().create
                            (token, object, uri);
                    }
                } catch (ObjectAlreadyExistsException e) {
View Full Code Here

     * @throws SourceException if an exception occurs.
     */
    public void createCollection(String collectionname)
      throws SourceException {

        SubjectNode collection = new SubjectNode();
        NodeRevisionDescriptor revisionDescriptor = new NodeRevisionDescriptor(0);

        // Resource type
        revisionDescriptor.setResourceType("<collection/>");

View Full Code Here

                }

            } catch (ObjectNotFoundException e) {

                // Todo : Check to see if parent exists
                SubjectNode subject = new SubjectNode();

                try {
                    // Creating an object
                    structure.create(slideToken, subject,
                                     config.getFilesPath()+path);
View Full Code Here

     *
     * @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, serverUrl, config);
       
View Full Code Here

TOP

Related Classes of org.apache.slide.structure.SubjectNode

Copyright © 2018 www.massapicom. 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.