Changeset 4679
- Timestamp:
- 03/12/14 20:27:50 (10 years ago)
- 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 293 293 int updatedRows = dbIntegrityService.updateAnnotationBody(annotationID, annotationBody); 294 294 return new ObjectFactory().createResponseBody(dbIntegrityService.makeAnnotationResponseEnvelope(annotationID)); 295 } else { 295 } else { 296 296 verboseOutput.FORBIDDEN_ANNOTATION_WRITING(externalIdentifier, dbIntegrityService.getAnnotationOwner(annotationID).getDisplayName(), dbIntegrityService.getAnnotationOwner(annotationID).getEMail()); 297 297 } … … 353 353 Number remoteUserID = this.getUserID(); 354 354 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 372 367 } 373 368 return new ObjectFactory().createResponseBody(new ResponseBody()); -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
r4671 r4679 105 105 </security-role> 106 106 107 107 <!-- <filter> 108 108 <filter-name>AAIFilter</filter-name> 109 109 <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class>
Note: See TracChangeset
for help on using the changeset viewer.