Package org.apache.slide.security

Examples of org.apache.slide.security.NodePermission


    public Element encodePermissions() {
        Element aPermissions=new Element("permissions");
        if (permissions==null) return aPermissions;
       
        for (int aSize=permissions.size(),i=0;i<aSize;i++) {
            NodePermission aPermission=(NodePermission)permissions.elementAt(i);
            aPermissions.addContent(encodeNodePermission(aPermission));
        }
        return aPermissions;
    }
View Full Code Here


        aElement.setAttribute("type",aProp.getType());
        aElement.setAttribute("protected",booleanToString(aProp.isProtected()));
        Element aPermissions=new Element("permissions");
       
        for (Enumeration aEnum=aProp.enumeratePermissions();aEnum.hasMoreElements();) {
            NodePermission aPermission=(NodePermission)aEnum.nextElement();
            aPermissions.addContent(encodeNodePermission(aPermission));
        }
        aElement.addContent(aPermissions);
        return aElement;
    }
View Full Code Here

        String aRevisionNumber=aElement.getAttributeValue("revisionNumber");
        String aSubject=aElement.getAttributeValue("subjectUri");
        String aAction=aElement.getAttributeValue("actionUri");
        boolean aInheritable=new Boolean(aElement.getAttributeValue("inheritable")).booleanValue();
        boolean aNegative=new Boolean(aElement.getAttributeValue("negative")).booleanValue();
        return new NodePermission(aUri,aRevisionNumber,aSubject,aAction,aInheritable,aNegative);

    }
View Full Code Here

       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Security security = nat.getSecurityHelper();
       
        try {
            NodePermission permission = new NodePermission(uri,subject,action);
            nat.begin();
            security.revokePermission(slideToken,permission);
            nat.commit();
        }
        catch (Exception e) {
View Full Code Here

       
        boolean isInheritable  = Boolean.valueOf(inheritable).booleanValue();
        boolean isNegative     = Boolean.valueOf(negative).booleanValue();
       
        try {
            NodePermission permission = new NodePermission(uri,subject,action,isInheritable,isNegative);
           
            nat.begin();
            if (isNegative) {
                security.denyPermission(slideToken,permission);
            }
View Full Code Here

                }
                boolean negative = false;
                if (res.getInt(PERMISSIONS_NEGATIVE) == 1) {
                    negative = true;
                }
                NodePermission permission =
                    new NodePermission(object,revision,subject,
                                       action,inheritable,negative);
                permissionVector.addElement(permission);
            }
           
        } catch (SQLException e) {
View Full Code Here

                if ("NULL".equals(revision)) {
                    revision = null;
                }
                boolean inheritable = (res.getInt(5) == 1);
                boolean negative = (res.getInt(6) == 1);
                NodePermission permission =
                    new NodePermission(object, revision, subject, action, inheritable, negative);
                permissions.add(permission);
            }
        } catch (SQLException e) {
            throw createException(e, uri.toString());
        } finally {
View Full Code Here

                        negative = true;
                    }
                } catch (ConfigurationException e) {
                }
               
                NodePermission permission = new NodePermission
                    (uri, subjectUri, actionUri, inheritable, negative);
               
                // Adding the NodePermission to the ObjectNode
                accessToken.getSecurityHelper()
                    .grantPermission(token, permission);
View Full Code Here

                throw new PreconditionViolationException(
                    new ViolatedPrecondition("not-supported-privilege", WebdavStatus.SC_BAD_REQUEST), resourcePath
                );
            }
            else {
                NodePermission np = new NodePermission(objectUri, subjectUri, actionUri, true, negative);
                np.setInvert(invert);
                result.add(np);
            }
        }
        return result;
    }
View Full Code Here

  /**
   * Always returns read access for all users.
   */
  public Enumeration enumeratePermissions(Uri uri) throws ServiceAccessException {
    Vector permissions = new Vector();
    permissions.add( new NodePermission( uri.toString(), "all", "/actions/read" ) );
    return permissions.elements();
  }
View Full Code Here

TOP

Related Classes of org.apache.slide.security.NodePermission

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.