Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorGroups.java @ 91:cf44d9e1a4a7
let CORS be handled by Restlet 2.3 CorsFilter.
author | casties |
---|---|
date | Sun, 08 Feb 2015 18:09:00 +0100 |
parents | b406507a953d |
children |
comparison
equal
deleted
inserted
replaced
90:475ab3d32630 | 91:cf44d9e1a4a7 |
---|---|
45 * | 45 * |
46 * @author casties | 46 * @author casties |
47 * | 47 * |
48 */ | 48 */ |
49 public class AnnotatorGroups extends AnnotatorResourceImpl { | 49 public class AnnotatorGroups extends AnnotatorResourceImpl { |
50 protected String getAllowedMethodsForHeader() { | |
51 return "OPTIONS,GET"; | |
52 } | |
53 | 50 |
54 /** | 51 /** |
55 * GET with JSON content-type. | 52 * GET with JSON content-type. |
56 * Parameters: | 53 * Parameters: |
57 * user: short user name | 54 * user: short user name |
61 * @return | 58 * @return |
62 */ | 59 */ |
63 @Get("json") | 60 @Get("json") |
64 public Representation doGetJSON(Representation entity) { | 61 public Representation doGetJSON(Representation entity) { |
65 logger.fine("AnnotatorGroups doGetJSON!"); | 62 logger.fine("AnnotatorGroups doGetJSON!"); |
66 setCorsHeaders(); | |
67 // get user from auth token (preferred) | 63 // get user from auth token (preferred) |
68 Person authUser = getUserFromAuthToken(entity); | 64 Person authUser = getUserFromAuthToken(entity); |
69 JSONArray results = null; | 65 JSONArray results = null; |
70 if (authUser != null && authUser.groups != null) { | 66 if (authUser != null && authUser.groups != null) { |
71 results = getGroupsFromPerson(authUser); | 67 results = getGroupsFromPerson(authUser); |