|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserUtil
This is a backend service level interface that defines an api for user level operations.
Field Summary | |
---|---|
static String |
META_PROPERTY_PREFIX
|
Method Summary | |
---|---|
void |
addToJiraUsePermission(User user)
Takes the given user and adds him/her to all the groups that grant a user the global JIRA use permission. |
void |
addUserToGroup(Group group,
User userToAdd)
This is used to add a specified user to a specified group. |
void |
addUserToGroups(Collection groups,
User userToAdd)
This is used to add a user to many groups at once. |
boolean |
canActivateNumberOfUsers(int numUsers)
Returns true if, after adding the specified number of users, the number of active users in JIRA does not exceed the user limit allowed by the license. |
boolean |
canActivateUsers(Collection userNames)
Returns true if, after adding the specified users, the number of active users in JIRA does not exceed the user limit allowed by the license. |
void |
clearActiveUserCount()
Clears the cache of the active user count so that it can be recalculated. |
User |
createJiraUser(String username,
String password,
String email,
String fullname)
Create a JIRA user. |
User |
createJiraUserPreserveCase(String username,
String password,
String email,
String fullname)
Create a JIRA user. |
int |
getActiveUserCount()
Returns the number of users that are currently 'active'. |
Collection |
getAdministrators()
Returns a list of JIRA admin User s. |
String |
getDisplayableNameSafely(User user)
Takes the given user and returns a "displayable name" by cautiously checking the different edge cases for users. |
Collection |
getSystemAdministrators()
Returns a list of JIRA system admin User s. |
User |
getUser(String userName)
Returns a user based on user name. |
boolean |
hasExceededUserLimit()
Returns true if this JIRA instance has more active users, than allowed by the license. |
void |
removeUser(User user)
Deletes the user and removes the user from all the groups. |
void |
removeUserFromGroup(Group group,
User userToRemove)
This is used to remove a specified user from a specified group. |
void |
removeUserFromGroups(Collection groups,
User userToRemove)
This is used to remove a user from many groups at once. |
boolean |
userExists(String userName)
Returns true if the a user exists with the specified userName |
Field Detail |
---|
static final String META_PROPERTY_PREFIX
Method Detail |
---|
void addUserToGroup(Group group, User userToAdd)
group
- the group to add the user to.userToAdd
- the user to add to the group.void addUserToGroups(Collection groups, User userToAdd)
groups
- a list containing the groups to add the user to.userToAdd
- the user to add to the group.void removeUserFromGroup(Group group, User userToRemove)
group
- the group to add the user to.userToRemove
- the user to add to the group.void removeUserFromGroups(Collection groups, User userToRemove)
groups
- a list containing the groups to add the user to.userToRemove
- the user to add to the group.int getActiveUserCount()
clearActiveUserCount()
to clear the cache.
Please note that the calculation will be run if the license does not specify a user limit.
Permissions
void clearActiveUserCount()
boolean hasExceededUserLimit()
boolean canActivateNumberOfUsers(int numUsers)
numUsers
- the number of users to add to the JIRA instance. If 0, all things being equal, this method will
return true. Must not be negative!
boolean canActivateUsers(Collection userNames)
userNames
- the names of the users to add to the JIRA instance. Must not be null!
User getUser(String userName)
userName
- the user name of the user
boolean userExists(String userName)
userName
- the name of the user
Collection getAdministrators()
User
s.
User
s.Collection getSystemAdministrators()
User
s.
Group
's that are associated with the
Permissions.SYSTEM_ADMIN
permission.User createJiraUser(String username, String password, String email, String fullname) throws DuplicateEntityException, ImmutableException
If password is specified as null, a new password will be generated for the user.
NOTE: This method does not fire any user events, you will need to fire them yourself if you want to.
username
- the user name for the userpassword
- the password. This may be null to generate a new passwordemail
- the email address of the userfullname
- the user's full name
DuplicateEntityException
- If the user already exists
ImmutableException
- If osuser has been misconfiguredcreateJiraUserPreserveCase(String, String, String, String)
User createJiraUserPreserveCase(String username, String password, String email, String fullname) throws DuplicateEntityException, ImmutableException
If password is specified as null, a new password will be generated for the user.
NOTE: This method does not fire any user events, you will need to fire them yourself if you want to.
username
- the user name for the userpassword
- the password. This may be null to generate a new passwordemail
- the email address of the userfullname
- the user's full name
DuplicateEntityException
- If the user already exists
ImmutableException
- If osuser has been misconfiguredcreateJiraUser(String, String, String, String)
void removeUser(User user)
user
- the user to deletevoid addToJiraUsePermission(User user)
Permissions.USE
)
Note: operation is only performed if by doing so we will not exceed the user limit (if the current license happens
to specify a limit)
user
- The user to be added to the USE permissionString getDisplayableNameSafely(User user)
user
- the user. May be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |