Ignore:
Timestamp:
Aug 28, 2012, 6:23:12 PM (12 years ago)
Author:
casties
Branch:
default
Message:

ASSIGNED - # 249: Annotations shared in groups
https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/ticket/249

File:
1 edited

Legend:

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

    r14 r15  
    1616
    1717import de.mpiwg.itgroup.annotations.Annotation;
     18import de.mpiwg.itgroup.annotations.Person;
     19import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
    1820
    1921/**
     
    4244        setCorsHeaders();
    4345        // do authentication
    44         String authUser = this.checkAuthToken(entity);
     46        Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
    4547        logger.debug("request authenticated=" + authUser);
    4648
     
    5456        // do search
    5557        logger.debug(String.format("searching for uri=%s user=%s", uri, user));
    56         List<Annotation> annots = getAnnotationStore().searchByUriUser(uri, user, limit, offset);
     58        AnnotationStore store = getAnnotationStore();
     59        List<Annotation> annots = store.searchByUriUser(uri, user, limit, offset);
    5760        for (Annotation annot : annots) {
    5861            // check permission
    59             if (!annot.isActionAllowed("read", authUser)) continue;
     62            if (!annot.isActionAllowed("read", authUser, store)) continue;
    6063            JSONObject jo = createAnnotatorJson(annot, (authUser == null));
    6164            if (jo != null) {
Note: See TracChangeset for help on using the changeset viewer.