|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.user.util.UserUtilImpl
public class UserUtilImpl
This is the default implementation of the UserUtil interface.
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.jira.user.util.UserUtil |
|---|
META_PROPERTY_PREFIX |
| Constructor Summary | |
|---|---|
UserUtilImpl(ComponentLocator componentLocator,
IssueSecurityLevelManager issueSecurityLevelManager,
GlobalPermissionManager globalPermissionManager,
UserManager userManager,
PermissionManager permissionManager,
ApplicationProperties applicationProperties,
SearchProvider searchProvider,
ProjectManager projectManager,
ProjectRoleService projectRoleService,
ProjectComponentManager componentManager,
SubscriptionManager subscriptionManager,
NotificationSchemeManager notificationSchemeManager,
UserHistoryManager userHistoryManager)
|
|
| 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<Group> 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<String> 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 |
createUserNoEvent(String username,
String password,
String email,
String fullname)
Given a valid validation result, this will create the user using the details provided in the validation result. |
User |
createUserWithEvent(String username,
String password,
String email,
String fullname,
int userEventType)
Given a valid validation result, this will create the user using the details provided in the validation result. |
protected void |
dispatchEvent(User user,
int userEventType,
Map<?,?> args)
|
int |
getActiveUserCount()
Returns the number of users that are currently 'active'. |
Collection<User> |
getAdministrators()
Returns a list of JIRA admin Users. |
Set<User> |
getAllUsers()
Returns the all user-names defined in JIRA, regardless of whether they are active or not. |
Collection<ProjectComponent> |
getComponentsUserLeads(User user)
Retrieve a collection of ProjectComponents - where the lead of each component is the specified user. |
String |
getDisplayableNameSafely(User user)
Takes the given user and returns a "displayable name" by cautiously checking the different edge cases for users. |
Group |
getGroup(String groupName)
Returns a Group based on user name. |
long |
getNumberOfAssignedIssuesIgnoreSecurity(User loggedInUser,
User user)
Returns number of issues assigned to user |
long |
getNumberOfReportedIssuesIgnoreSecurity(User loggedInUser,
User user)
Returns number of issues reported by user |
protected PortalPageService |
getPortalPageService()
A Factory method to get the PortalPageService. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsUserLeads(User user)
Returns all the projects that leadUser is the project lead for. |
protected SearchRequestService |
getSearchRequestService()
A Factory method to get the SearchRequestService. |
protected JiraServiceContext |
getServiceContext(User user)
Protected level factory method to allow for better test integration |
Collection<User> |
getSystemAdministrators()
Returns a list of JIRA system admin Users. |
int |
getTotalUserCount()
Returns the total number of users defined in JIRA, regardless of whether they are active or not. |
User |
getUser(String userName)
Returns a user based on user name. |
SortedSet<User> |
getUsersInGroupNames(Collection<String> groupNames)
Returns a collection of User objects that are found within the passed in collection of group names. |
SortedSet<User> |
getUsersInGroups(Collection<Group> groups)
Returns a collection of User objects that are found within the passed in collection of Group objects. |
boolean |
hasExceededUserLimit()
Returns true if this JIRA instance has more active users, than allowed by the license. |
boolean |
isNonSysAdminAttemptingToDeleteSysAdmin(User loggedInUser,
User user)
Checking if user without SYSTEM_ADMIN rights tries to remove user with SYSTEM_ADMIN rights. |
void |
removeUser(User loggedInUser,
User user,
I18nHelper i18nBean)
Given a valid validation result, this will remove 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<Group> 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserUtilImpl(ComponentLocator componentLocator,
IssueSecurityLevelManager issueSecurityLevelManager,
GlobalPermissionManager globalPermissionManager,
UserManager userManager,
PermissionManager permissionManager,
ApplicationProperties applicationProperties,
SearchProvider searchProvider,
ProjectManager projectManager,
ProjectRoleService projectRoleService,
ProjectComponentManager componentManager,
SubscriptionManager subscriptionManager,
NotificationSchemeManager notificationSchemeManager,
UserHistoryManager userHistoryManager)
| Method Detail |
|---|
protected SearchRequestService getSearchRequestService()
protected PortalPageService getPortalPageService()
protected JiraServiceContext getServiceContext(User user)
user - the user in action
public User createUserNoEvent(String username,
String password,
String email,
String fullname)
throws ImmutableException,
DuplicateEntityException
UserUtil
createUserNoEvent in interface UserUtilusername - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.email - The email for the new user. Needs to be a valid email address.fullname - The full name for the new user
ImmutableException - Generic exception ocurred when creating the user
DuplicateEntityException - User with this username alread exists
public User createUserWithEvent(String username,
String password,
String email,
String fullname,
int userEventType)
throws ImmutableException,
DuplicateEntityException
UserUtil
createUserWithEvent in interface UserUtilusername - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.email - The email for the new user. Needs to be a valid email address.fullname - The full name for the new useruserEventType - The event type dispatched on user creation
ImmutableException - Generic exception ocurred when creating the user
DuplicateEntityException - User with this username alread exists
protected void dispatchEvent(User user,
int userEventType,
Map<?,?> args)
public void removeUser(User loggedInUser,
User user,
I18nHelper i18nBean)
UserUtil
removeUser in interface UserUtilloggedInUser - username of the user performing operationuser - the user to deletei18nBean - unused may as well be null
public long getNumberOfReportedIssuesIgnoreSecurity(User loggedInUser,
User user)
throws SearchException
UserUtil
getNumberOfReportedIssuesIgnoreSecurity in interface UserUtiluser - User
SearchException
public long getNumberOfAssignedIssuesIgnoreSecurity(User loggedInUser,
User user)
throws SearchException
UserUtil
getNumberOfAssignedIssuesIgnoreSecurity in interface UserUtilSearchExceptionpublic Collection<ProjectComponent> getComponentsUserLeads(User user)
UserUtil
getComponentsUserLeads in interface UserUtiluser - User leading components
public Collection<org.ofbiz.core.entity.GenericValue> getProjectsUserLeads(User user)
UserUtil
getProjectsUserLeads in interface UserUtilGenericValues
public boolean isNonSysAdminAttemptingToDeleteSysAdmin(User loggedInUser,
User user)
UserUtil
isNonSysAdminAttemptingToDeleteSysAdmin in interface UserUtilloggedInUser - User performing operationuser - User for remove
public void addUserToGroup(Group group,
User userToAdd)
UserUtil
addUserToGroup in interface UserUtilgroup - the group to add the user to.userToAdd - the user to add to the group.
public void addUserToGroups(Collection<Group> groups,
User userToAdd)
UserUtil
addUserToGroups in interface UserUtilgroups - a list containing the groups to add the user to.userToAdd - the user to add to the group.
public void removeUserFromGroup(Group group,
User userToRemove)
UserUtil
removeUserFromGroup in interface UserUtilgroup - the group to add the user to.userToRemove - the user to add to the group.
public void removeUserFromGroups(Collection<Group> groups,
User userToRemove)
UserUtil
removeUserFromGroups in interface UserUtilgroups - a list containing the groups to add the user to.userToRemove - the user to add to the group.public int getActiveUserCount()
UserUtilUserUtil.clearActiveUserCount() to clear the cache.
Please note that the calculation will be run if the license does not specify a user limit.
getActiveUserCount in interface UserUtilPermissionspublic void clearActiveUserCount()
UserUtil
clearActiveUserCount in interface UserUtilpublic boolean hasExceededUserLimit()
UserUtil
hasExceededUserLimit in interface UserUtilpublic boolean canActivateNumberOfUsers(int numUsers)
UserUtil
canActivateNumberOfUsers in interface UserUtilnumUsers - 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!
public boolean canActivateUsers(Collection<String> userNames)
UserUtil
canActivateUsers in interface UserUtiluserNames - the names of the users to add to the JIRA instance. Must not be null!
public Set<User> getAllUsers()
UserUtil
getAllUsers in interface UserUtilpublic int getTotalUserCount()
UserUtil
getTotalUserCount in interface UserUtilpublic User getUser(String userName)
UserUtil
getUser in interface UserUtiluserName - the user name of the user
public boolean userExists(String userName)
UserUtil
userExists in interface UserUtiluserName - the name of the user
public Collection<User> getAdministrators()
UserUtilUsers.
getAdministrators in interface UserUtilUsers.public Collection<User> getSystemAdministrators()
UserUtilUsers.
getSystemAdministrators in interface UserUtilGroup's that are associated with the Permissions.SYSTEM_ADMIN permission.public void addToJiraUsePermission(User user)
UserUtilPermissions.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)
addToJiraUsePermission in interface UserUtiluser - The user to be added to the USE permissionpublic String getDisplayableNameSafely(User user)
UserUtil
getDisplayableNameSafely in interface UserUtiluser - the user. May be null.
public SortedSet<User> getUsersInGroups(Collection<Group> groups)
UserUtilUser objects that are found within the passed in collection of Group objects.
getUsersInGroups in interface UserUtilgroups - a collection of Group objects
BestNameComparator orderpublic SortedSet<User> getUsersInGroupNames(Collection<String> groupNames)
UserUtilUser objects that are found within the passed in collection of group names.
getUsersInGroupNames in interface UserUtilgroupNames - a collection of group name strings
BestNameComparator orderpublic Group getGroup(String groupName)
UserUtilGroup based on user name.
getGroup in interface UserUtilgroupName - the user name of the group
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||