Changeset 4679


Ignore:
Timestamp:
03/12/14 20:27:50 (10 years ago)
Author:
olhsha
Message:

debugging and testing

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java

    r4603 r4679  
    293293                        int updatedRows = dbIntegrityService.updateAnnotationBody(annotationID, annotationBody);
    294294                        return new ObjectFactory().createResponseBody(dbIntegrityService.makeAnnotationResponseEnvelope(annotationID));
    295                     } else { 
     295                    } else {
    296296                        verboseOutput.FORBIDDEN_ANNOTATION_WRITING(externalIdentifier, dbIntegrityService.getAnnotationOwner(annotationID).getDisplayName(), dbIntegrityService.getAnnotationOwner(annotationID).getEMail());
    297297                    }
     
    353353        Number remoteUserID = this.getUserID();
    354354        if (remoteUserID != null) {
    355             try {
    356                 final Number annotationID = dbIntegrityService.getResourceInternalIdentifier(UUID.fromString(annotationExternalId), Resource.ANNOTATION);
    357                 if (annotationID != null) {
    358                     if (remoteUserID.equals(dbIntegrityService.getAnnotationOwnerID(annotationID)) || dbIntegrityService.getTypeOfUserAccount(remoteUserID).equals(admin)) {
    359                         int updatedRows = dbIntegrityService.updatePermissions(annotationID, permissions);
    360                         return new ObjectFactory().createResponseBody(dbIntegrityService.makePermissionResponseEnvelope(annotationID, Resource.ANNOTATION));
    361                     } else {
    362                         verboseOutput.FORBIDDEN_PERMISSION_CHANGING(annotationExternalId, dbIntegrityService.getAnnotationOwner(annotationID).getDisplayName(), dbIntegrityService.getAnnotationOwner(annotationID).getEMail());
    363                     }
    364                 } else {
    365                     verboseOutput.ANNOTATION_NOT_FOUND(annotationExternalId);
    366                 }
    367 
    368 
    369             } catch (IllegalArgumentException e) {
    370                 verboseOutput.ILLEGAL_UUID(annotationExternalId);
    371             }
     355            final Number annotationID = dbIntegrityService.getResourceInternalIdentifier(UUID.fromString(annotationExternalId), Resource.ANNOTATION);
     356            if (annotationID != null) {
     357                if (remoteUserID.equals(dbIntegrityService.getAnnotationOwnerID(annotationID)) || dbIntegrityService.getTypeOfUserAccount(remoteUserID).equals(admin)) {
     358                    int updatedRows = dbIntegrityService.updatePermissions(annotationID, permissions);
     359                    return new ObjectFactory().createResponseBody(dbIntegrityService.makePermissionResponseEnvelope(annotationID, Resource.ANNOTATION));
     360                } else {
     361                    verboseOutput.FORBIDDEN_PERMISSION_CHANGING(annotationExternalId, dbIntegrityService.getAnnotationOwner(annotationID).getDisplayName(), dbIntegrityService.getAnnotationOwner(annotationID).getEMail());
     362                }
     363            } else {
     364                verboseOutput.ANNOTATION_NOT_FOUND(annotationExternalId);
     365            }
     366
    372367        }
    373368        return new ObjectFactory().createResponseBody(new ResponseBody());
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml

    r4671 r4679  
    105105    </security-role>
    106106   
    107     <!--    <filter>
     107<!--    <filter>
    108108        <filter-name>AAIFilter</filter-name>
    109109        <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
Note: See TracChangeset for help on using the changeset viewer.