Skip to content

Instantly share code, notes, and snippets.

@jeanouii
Created March 18, 2015 05:23
Show Gist options
  • Select an option

  • Save jeanouii/1937acbf411402758892 to your computer and use it in GitHub Desktop.

Select an option

Save jeanouii/1937acbf411402758892 to your computer and use it in GitHub Desktop.
@GET
@Path("/users/{username}")
@Description("Return the user with the specified user name, if any;" +
" otherwise return <code>null</code>.")
public UserInfo findUser(
@PathParam("username") @Required
@Description("Name of the user to return")
final String username) {
...
@POST
@Path("/users")
@RolesAllowed({ManagementApplication.TRIBESTRM_ADMIN, ManagementApplication.CONSOLE_ADMIN})
@Description("Create and return a new user defined in this user database.")
public UserInfo createUser(@Required @Description("The UserInfo payload to create. This change will take effect " +
"immediately and updates the conf/tomcat-users.xml file.")
final UserInfo info) {
...
}
@PUT
@Path("/users/{username}")
@RolesAllowed({ManagementApplication.TRIBESTRM_ADMIN, ManagementApplication.CONSOLE_ADMIN})
@Description("Update and return the updated user defined in this user database. This change will take effect " +
"immediately and updates the conf/tomcat-users.xml file.")
public UserInfo updateUser(
@PathParam("username") @Required
@Description("The logon username of the new user (must be unique)")
final String username,
@Required @Description("The UserInfo payload to update.")
final UserInfo info) {
...
}
@DELETE
@Path("/users/{username}")
@RolesAllowed({ManagementApplication.TRIBESTRM_ADMIN, ManagementApplication.CONSOLE_ADMIN})
@Description("Remove the specified user from this user database. This change will take effect immediately and " +
"updates the conf/tomcat-users.xml file.")
public void removeUser(
@PathParam("username") @Required
@Description("Name of the user to remove")
final String username) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment