public class UserManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
addUserToGroup(User user,
Group group)
Adds the given user to the given group.
|
Group |
createGroup(Group base)
Creates a new group.
|
User |
createUser(User user) |
void |
deleteGroup(Group base)
Deletes a group.
|
void |
deleteUser(java.lang.Integer userId) |
User |
getCurrentUser() |
Group |
getGroupById(int id)
Returns the group based on its id.
|
Group |
getGroupByName(java.lang.String name)
Returns the group based on its name.
|
java.util.List<Group> |
getGroups()
Load the list of groups on the server.
|
Role |
getRoleById(int id) |
java.util.List<Role> |
getRoles() |
User |
getUserById(java.lang.Integer userId)
This does NOT require Admin privileges by default Redmine installation (tested with Redmine 2.0.3).
|
java.util.List<User> |
getUsers()
Load the list of users on the server.
|
void |
update(Group group) |
void |
update(User obj) |
public User getCurrentUser() throws RedmineException
RedmineExceptionpublic User createUser(User user) throws RedmineException
RedmineExceptionpublic void deleteUser(java.lang.Integer userId)
throws RedmineException
userId - user identifier (numeric ID)RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundException - if the user with the given id is not foundRedmineExceptionpublic void addUserToGroup(User user, Group group) throws RedmineException
user - - The user being added.group - - The new group of the user.RedmineExceptionpublic java.util.List<User> getUsers() throws RedmineException
This operation requires "Redmine Administrator" permission.
RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundExceptionRedmineExceptionpublic User getUserById(java.lang.Integer userId) throws RedmineException
RedmineExceptionpublic java.util.List<Group> getGroups() throws RedmineException
This operation requires "Redmine Administrator" permission.
RedmineAuthenticationException - invalid or no API access key is used with the server, which
requires authorization. Check the constructor arguments.NotFoundExceptionRedmineExceptionpublic Group getGroupById(int id) throws RedmineException
This operation requires "Redmine Administrators" permission.
id - the id of the groupRedmineExceptionpublic Group getGroupByName(java.lang.String name) throws RedmineException
This operation requires "Redmine Administrators" permission.
name - the name of the groupRedmineExceptionpublic Group createGroup(Group base) throws RedmineException
This operation requires "Redmine Administrator" permission.
RedmineExceptionpublic void deleteGroup(Group base) throws RedmineException
This operation requires "Redmine Administrator" permission.
RedmineExceptionpublic java.util.List<Role> getRoles() throws RedmineException
RedmineExceptionpublic Role getRoleById(int id) throws RedmineException
RedmineExceptionpublic void update(User obj) throws RedmineException
RedmineExceptionpublic void update(Group group) throws RedmineException
RedmineException