Package org.exist.security

Examples of org.exist.security.PermissionDeniedException


  *    of Permit or it has any <code>Obligation</code>s.
  */
  public void handleResponse(ResponseCtx response) throws PermissionDeniedException
  {
    if(response == null)
      {throw new PermissionDeniedException("The response was null");}

    final Set<Result> results = response.getResults();
    if(results == null || results.size() == 0)
      {throw new PermissionDeniedException("The response was empty");}

    for(final Result result : results)
      handleResult(result);
  }
View Full Code Here


     * @return The childCollectionCount value
     */
    public int getChildCollectionCount(final DBBroker broker) throws PermissionDeniedException {
   
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
       
       
        try {
            getLock().acquire(Lock.READ_LOCK);
View Full Code Here

  *    of Permit or it has any <code>Obligation</code>s.
  */
  public void handleResult(Result result) throws PermissionDeniedException
  {
    if(result == null)
      {throw new PermissionDeniedException("A result of a request's response was null");}

    final Set obligations = result.getObligations();
    if(obligations != null && obligations.size() > 0)
    {
      throw new PermissionDeniedException("The XACML response had obligations that could not be fulfilled.");
    }

    final int decision = result.getDecision();
    if(decision == Result.DECISION_PERMIT)
      {return;}

    throw new PermissionDeniedException("The response did not permit the request.  The decision was: " + getDecisionString(decision, result.getStatus()));
  }
View Full Code Here

     * Determines if this Collection has any documents, or sub-collections
     */
    public boolean isEmpty(final DBBroker broker) throws PermissionDeniedException {
       
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
       
        try {
            getLock().acquire(Lock.READ_LOCK);
            return documents.isEmpty() && subCollections.isEmpty();
View Full Code Here

        try {
            getLock().acquire(Lock.READ_LOCK);
            final DocumentImpl doc = documents.get(path.getRawCollectionPath());
            if(doc != null){
                if(!doc.getPermissions().validate(broker.getSubject(), Permission.READ)) {
                    throw new PermissionDeniedException("Permission denied to read document: " + path.toString());
                }
            } else {
              LOG.debug("Document " + path + " not found!");
            }
           
View Full Code Here

            getLock().acquire(Lock.READ_LOCK);
            final DocumentImpl doc = documents.get(uri.getRawCollectionPath());
           
            if(doc != null) {
                if(!doc.getPermissions().validate(broker.getSubject(), Permission.READ)) {
                    throw new PermissionDeniedException("Permission denied to read document: " + uri.toString());
                }
              doc.getUpdateLock().acquire(lockMode);
            }
            return doc;
        } finally {
View Full Code Here

    public DocumentImpl getDocumentNoLock(final DBBroker broker, final String rawPath) throws PermissionDeniedException {
        final DocumentImpl doc = documents.get(rawPath);
        if(doc != null) {
            if(!doc.getPermissions().validate(broker.getSubject(), Permission.READ)) {
                throw new PermissionDeniedException("Permission denied to read document: " + rawPath);
            }
        }
        return doc;
    }
View Full Code Here

     *
     * @return The documentCount value
     */
    public int getDocumentCount(final DBBroker broker) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
       
        try {
            getLock().acquire(Lock.READ_LOCK);
            return documents.size();
View Full Code Here

        }
    }

    public int getDocumentCountNoLock(final DBBroker broker) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
        return documents.size();
    }
View Full Code Here

     * @param  uri  the name (without path) of the document
     * @return A value of true when the collection has the document identified.
     */
    public boolean hasDocument(final DBBroker broker, final XmldbURI uri) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
       
        return documents.containsKey(uri.getRawCollectionPath());
    }
View Full Code Here

TOP

Related Classes of org.exist.security.PermissionDeniedException

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.