Ignore:
Timestamp:
Sep 4, 2012, 6:02:59 PM (12 years ago)
Author:
casties
Branch:
default
Message:

CLOSED - # 252: Tags for Annotations
https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/ticket/252

File:
1 edited

Legend:

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

    r15 r16  
    5555        logger.debug("request authenticated=" + authUser);
    5656
    57         Annotation annot = getAnnotationStore().getAnnotationById(id);
     57        AnnotationStore store = getAnnotationStore();
     58        Annotation annot = store.getAnnotationById(id);
    5859        if (annot != null) {
    59             if (! annot.isActionAllowed("read", authUser, null)) {
     60            if (! annot.isActionAllowed("read", authUser, store)) {
    6061                setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
    6162                return null;
     
    160161                return null;
    161162            }
    162             if (! storedAnnot.isActionAllowed("update", authUser, null)) {
     163            if (! storedAnnot.isActionAllowed("update", authUser, store)) {
    163164                setStatus(Status.CLIENT_ERROR_FORBIDDEN);
    164165                return null;
     
    207208        Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
    208209        logger.debug("request authenticated=" + authUser);
    209         Annotation annot = getAnnotationStore().getAnnotationById(id);
     210        AnnotationStore store = getAnnotationStore();
     211        Annotation annot = store.getAnnotationById(id);
    210212        if (annot != null) {
    211             if (! annot.isActionAllowed("delete", authUser, null)) {
     213            if (! annot.isActionAllowed("delete", authUser, store)) {
    212214                setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
    213215                return null;
     
    216218       
    217219        // delete annotation
    218         getAnnotationStore().deleteById(id);
     220        store.deleteById(id);
    219221        setStatus(Status.SUCCESS_NO_CONTENT);
    220222        return null;
Note: See TracChangeset for help on using the changeset viewer.