@RequireOrganizationAccess
  @GET
  @Path("feed")
  public JSONWithPadding getFeed(
      @Context UriInfo ui, @QueryParam("callback") @DefaultValue("callback") String callback)
      throws Exception {

    ApiResponse response = createApiResponse();
    response.setAction("get organization feed");

    ServiceResults results = management.getOrganizationActivity(organization);
    response.setEntities(results.getEntities());
    response.setSuccess();

    return new JSONWithPadding(response, callback);
  }
Ejemplo n.º 2
0
  @RequireAdminUserAccess
  @GET
  public JSONWithPadding getUserData(
      @Context UriInfo ui,
      @QueryParam("ttl") long ttl,
      @QueryParam("callback") @DefaultValue("callback") String callback)
      throws Exception {

    ApiResponse response = createApiResponse();
    response.setAction("get admin user");

    String token = management.getAccessTokenForAdminUser(SubjectUtils.getUser().getUuid(), ttl);
    Map<String, Object> userOrganizationData =
        management.getAdminUserOrganizationData(user.getUuid());
    userOrganizationData.put("token", token);
    response.setData(userOrganizationData);
    response.setSuccess();

    return new JSONWithPadding(response, callback);
  }