Changeset 16:794077e6288c 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
r15 r16 55 55 logger.debug("request authenticated=" + authUser); 56 56 57 Annotation annot = getAnnotationStore().getAnnotationById(id); 57 AnnotationStore store = getAnnotationStore(); 58 Annotation annot = store.getAnnotationById(id); 58 59 if (annot != null) { 59 if (! annot.isActionAllowed("read", authUser, null)) {60 if (! annot.isActionAllowed("read", authUser, store)) { 60 61 setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!"); 61 62 return null; … … 160 161 return null; 161 162 } 162 if (! storedAnnot.isActionAllowed("update", authUser, null)) {163 if (! storedAnnot.isActionAllowed("update", authUser, store)) { 163 164 setStatus(Status.CLIENT_ERROR_FORBIDDEN); 164 165 return null; … … 207 208 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 208 209 logger.debug("request authenticated=" + authUser); 209 Annotation annot = getAnnotationStore().getAnnotationById(id); 210 AnnotationStore store = getAnnotationStore(); 211 Annotation annot = store.getAnnotationById(id); 210 212 if (annot != null) { 211 if (! annot.isActionAllowed("delete", authUser, null)) {213 if (! annot.isActionAllowed("delete", authUser, store)) { 212 214 setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!"); 213 215 return null; … … 216 218 217 219 // delete annotation 218 getAnnotationStore().deleteById(id);220 store.deleteById(id); 219 221 setStatus(Status.SUCCESS_NO_CONTENT); 220 222 return null;
Note: See TracChangeset
for help on using the changeset viewer.