Ignore:
Timestamp:
Sep 26, 2012, 12:48:41 PM (12 years ago)
Author:
dwinter
Branch:
default
Message:

authorisation added
js / css aufgeraeumt

File:
1 edited

Legend:

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

    r34 r37  
    5656        logger.debug("annotation-id=" + id);
    5757
     58       
     59        // do authentication
     60        Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
     61        logger.debug("request authenticated=" + authUser);
     62
    5863        if (id == null) {
    5964           
    60             return getAllAnnotations();
    61         }
    62 
    63         // do authentication
    64         Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
    65         logger.debug("request authenticated=" + authUser);
    66 
     65            return getAllAnnotations(authUser);
     66        }
     67
     68     
    6769        AnnotationStore store = getAnnotationStore();
    6870        Annotation annot = store.getAnnotationById(id);
     
    8385    }
    8486
    85     private Representation getAllAnnotations() {
     87    private Representation getAllAnnotations(Person authUser) {
    8688       
    8789         Form form = getRequest().getResourceRef().getQueryAsForm();
     
    98100        List<Annotation> annotations = store.getAnnotations(null, null);
    99101        for (Annotation annotation : annotations) {
    100                
     102                 //check permission
     103                         if (!annotation.isActionAllowed("read", authUser, store)) continue;
     104     
    101105                 JSONObject jo = createAnnotatorJson(annotation,false);
    102106             results.add(jo);
Note: See TracChangeset for help on using the changeset viewer.