Changeset 15:58357a4b86de in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorSearch.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorSearch.java
r14 r15 16 16 17 17 import de.mpiwg.itgroup.annotations.Annotation; 18 import de.mpiwg.itgroup.annotations.Person; 19 import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore; 18 20 19 21 /** … … 42 44 setCorsHeaders(); 43 45 // do authentication 44 String authUser = this.checkAuthToken(entity);46 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 45 47 logger.debug("request authenticated=" + authUser); 46 48 … … 54 56 // do search 55 57 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); 57 60 for (Annotation annot : annots) { 58 61 // check permission 59 if (!annot.isActionAllowed("read", authUser )) continue;62 if (!annot.isActionAllowed("read", authUser, store)) continue; 60 63 JSONObject jo = createAnnotatorJson(annot, (authUser == null)); 61 64 if (jo != null) {
Note: See TracChangeset
for help on using the changeset viewer.