use of org.jbei.ice.lib.group.Groups in project ice by JBEI.
the class GroupResource method createGroup.
@POST
@Produces(MediaType.APPLICATION_JSON)
public Response createGroup(UserGroup userGroup) {
try {
String userId = requireUserId();
Groups groups = new Groups(userId);
return super.respond(groups.addGroup(userGroup));
} catch (PermissionException pe) {
return super.respond(Response.Status.FORBIDDEN);
}
}
use of org.jbei.ice.lib.group.Groups in project ice by JBEI.
the class GroupResource method matchGroupNames.
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/autocomplete")
public Response matchGroupNames(@QueryParam("token") String token, @DefaultValue("8") @QueryParam("limit") int limit) {
String userId = requireUserId();
Groups groups = new Groups(userId);
return super.respond(groups.getMatchingGroups(token, limit));
}
use of org.jbei.ice.lib.group.Groups in project ice by JBEI.
the class UserResource method getProfileGroups.
/**
* @return group listing for a user
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{id}/groups")
public Response getProfileGroups(@PathParam("id") long userId) {
String userIdStr = requireUserId();
log(userIdStr, " get profile groups");
Groups userGroups = new Groups(userIdStr);
return super.respond(userGroups.get(userId));
}
use of org.jbei.ice.lib.group.Groups in project ice by JBEI.
the class GroupResource method updateGroup.
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Path("/{id}")
public Response updateGroup(@PathParam("id") long id, UserGroup group) {
String userId = requireUserId();
Groups groups = new Groups(userId);
return respond(groups.update(id, group));
}
use of org.jbei.ice.lib.group.Groups in project ice by JBEI.
the class GroupResource method getGroupMembers.
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{id}/members")
public Response getGroupMembers(@PathParam("id") long id) {
String userId = requireUserId();
Groups groups = new Groups(userId);
return super.respond(groups.getGroupMembers(id));
}
Aggregations