Changeset 37:34b9d044d0bf in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
r34 r37 56 56 logger.debug("annotation-id=" + id); 57 57 58 59 // do authentication 60 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 61 logger.debug("request authenticated=" + authUser); 62 58 63 if (id == null) { 59 64 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 67 69 AnnotationStore store = getAnnotationStore(); 68 70 Annotation annot = store.getAnnotationById(id); … … 83 85 } 84 86 85 private Representation getAllAnnotations( ) {87 private Representation getAllAnnotations(Person authUser) { 86 88 87 89 Form form = getRequest().getResourceRef().getQueryAsForm(); … … 98 100 List<Annotation> annotations = store.getAnnotations(null, null); 99 101 for (Annotation annotation : annotations) { 100 102 //check permission 103 if (!annotation.isActionAllowed("read", authUser, store)) continue; 104 101 105 JSONObject jo = createAnnotatorJson(annotation,false); 102 106 results.add(jo);
Note: See TracChangeset
for help on using the changeset viewer.