Package org.exist.security

Examples of org.exist.security.PermissionDeniedException


        return list;
    }

    public CollectionEntry getSubCollectionEntry(final DBBroker broker, final String name) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
        final XmldbURI subCollectionURI = getURI().append(name);
        final CollectionEntry entry = new SubCollectionEntry(subCollectionURI);
        entry.readMetadata(broker);
        return entry;
View Full Code Here


        return entry;
    }

    public CollectionEntry getResourceEntry(final DBBroker broker, final String name) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
        final CollectionEntry entry = new DocumentEntry(documents.get(name));
        entry.readMetadata(broker);
        return entry;
    }
View Full Code Here

    private void addDocument(final Txn transaction, final DBBroker broker, final DocumentImpl doc, final DocumentImpl oldDoc) throws PermissionDeniedException {
        if(oldDoc == null) {
           
            /* create */
            if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.WRITE)) {
                throw new PermissionDeniedException("Permission to write to Collection denied for " + this.getURI());
            }
        } else {
           
            /* update-replace */
            if(!oldDoc.getPermissions().validate(broker.getSubject(), Permission.WRITE)) {
                throw new PermissionDeniedException("Permission to write to overwrite document: " +  oldDoc.getURI());
            }
        }
       
        if (doc.getDocId() == DocumentImpl.UNKNOWN_DOCUMENT_ID) {
            try {
View Full Code Here

     *
     * @param doc
     */
    public void unlinkDocument(final DBBroker broker, final DocumentImpl doc) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.WRITE)) {
            throw new PermissionDeniedException("Permission denied to remove document from collection: " + path);
        }
        documents.remove(doc.getFileURI().getRawCollectionPath());
    }
View Full Code Here

     *
     * @return An iterator over the collections
     */
    public Iterator<XmldbURI> collectionIterator(final DBBroker broker) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission to list sub-collections denied on " + this.getURI());
        }
       
        try {
            getLock().acquire(Lock.READ_LOCK);
            return subCollections.stableIterator();
View Full Code Here

     *
     * @return An iterator over the collections
     */
    public Iterator<XmldbURI> collectionIteratorNoLock(final DBBroker broker) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission to list sub-collections denied on " + this.getURI());
        }
        return subCollections.stableIterator();
    }
View Full Code Here

     *
     * @return List
     */
    public List<Collection> getDescendants(final DBBroker broker, final Subject user) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission to list sub-collections denied on " + this.getURI());
        }
       
        final ArrayList<Collection> collectionList = new ArrayList<Collection>(subCollections.size());
        try {
            getLock().acquire(Lock.READ_LOCK);
View Full Code Here

  * @throws PermissionDeniedException if the request is not allowed
  */
  public void evaluate(RequestCtx request) throws PermissionDeniedException
  {
    if(request == null)
      {throw new PermissionDeniedException("Request cannot be null");}
   
    if(LOG.isDebugEnabled())
    {
      final ByteArrayOutputStream out = new ByteArrayOutputStream();
      request.encode(out, new Indenter(4));
View Full Code Here

     *
     * @param docs
     */
    public DocumentSet getDocuments(final DBBroker broker, final MutableDocumentSet docs) throws PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
       
        try {
            getLock().acquire(Lock.READ_LOCK);
            docs.addCollection(this);
View Full Code Here

        return docs;
    }

    public DocumentSet getDocuments(final DBBroker broker, final MutableDocumentSet docs, final LockedDocumentMap lockMap, final int lockType) throws LockException, PermissionDeniedException {
        if(!getPermissionsNoLock().validate(broker.getSubject(), Permission.READ)) {
            throw new PermissionDeniedException("Permission denied to read collection: " + path);
        }
       
        try {
            getLock().acquire(Lock.READ_LOCK);
            docs.addCollection(this);
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.