Changeset 41:5d4260344db5 in AnnotationManagerN4J


Ignore:
Timestamp:
Sep 26, 2012, 12:59:00 PM (12 years ago)
Author:
casties
Branch:
default
Parents:
40:03e0f7574224 (diff), 39:1cf5fca36633 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with 21c5394ea0cbb6738016a3c7d03b5ce7943d6216

Location:
src/main
Files:
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java

    r37 r41  
    2424import de.mpiwg.itgroup.annotations.Annotation;
    2525import de.mpiwg.itgroup.annotations.Person;
    26 import de.mpiwg.itgroup.annotations.Tag;
    2726import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
    2827import de.mpiwg.itgroup.annotations.restlet.utils.JSONObjectComparator;
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java

    r40 r41  
    5555        logger.debug("annotation-id=" + id);
    5656
     57       
     58        // do authentication
     59        Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
     60        logger.debug("request authenticated=" + authUser);
     61
    5762        if (id == null) {
    5863           
    59             return getAllAnnotations();
    60         }
    61 
    62         // do authentication
    63         Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
    64         logger.debug("request authenticated=" + authUser);
    65 
     64            return getAllAnnotations(authUser);
     65        }
     66
     67     
    6668        AnnotationStore store = getAnnotationStore();
    6769        Annotation annot = store.getAnnotationById(id);
     
    8284    }
    8385
    84     private Representation getAllAnnotations() {
     86    private Representation getAllAnnotations(Person authUser) {
    8587       
    8688         Form form = getRequest().getResourceRef().getQueryAsForm();
     
    9799        List<Annotation> annotations = store.getAnnotations(null, null);
    98100        for (Annotation annotation : annotations) {
    99                
     101                 //check permission
     102                         if (!annotation.isActionAllowed("read", authUser, store)) continue;
     103     
    100104                 JSONObject jo = createAnnotatorJson(annotation,false);
    101105             results.add(jo);
Note: See TracChangeset for help on using the changeset viewer.