Package com.atlassian.jira.user
Class DefaultUserProjectHistoryManager
java.lang.Object
com.atlassian.jira.user.DefaultUserProjectHistoryManager
- All Implemented Interfaces:
UserProjectHistoryManager
Convienience wrapper for the
UserHistoryManager that deals directly with Projects.- Since:
- v4.0
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUserProjectHistoryManager(UserHistoryManager userHistoryManager, ProjectManager projectManager, PermissionManager permissionManager, InternalProjectPermissionHelper projectPermissionHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProjectToHistory(ApplicationUser user, Project project) Add aProjectto the user hsitory list.getCurrentProject(int permission, ApplicationUser user) Gets the last viewed project that the user visted and still has permission to see.Retreive the user's project history queue.getProjectHistoryWithPermissionChecks(int permission, ApplicationUser user) Retreive the user's project history queue.getProjectHistoryWithPermissionChecks(ProjectAction projectAction, ApplicationUser user) Retreive the user's project history queue.booleanhasProjectHistory(int permission, ApplicationUser user) Determines whether the user has a current project history.
-
Constructor Details
-
DefaultUserProjectHistoryManager
public DefaultUserProjectHistoryManager(UserHistoryManager userHistoryManager, ProjectManager projectManager, PermissionManager permissionManager, InternalProjectPermissionHelper projectPermissionHelper)
-
-
Method Details
-
addProjectToHistory
Description copied from interface:UserProjectHistoryManagerAdd aProjectto the user hsitory list. A null users history should still be stored, even if only for duration of session- Specified by:
addProjectToHistoryin interfaceUserProjectHistoryManager- Parameters:
user- The user to add the history item toproject- The project to add to the history list
-
hasProjectHistory
Description copied from interface:UserProjectHistoryManagerDetermines whether the user has a current project history. This method also performs permission checks against the project to ensure that user can see atleast 1 project.- Specified by:
hasProjectHistoryin interfaceUserProjectHistoryManager- Parameters:
permission- the permission to check againstuser- The user to check for.- Returns:
- true if the user has at least 1 project in their project history queue that they can see, false otherwise
-
getCurrentProject
Description copied from interface:UserProjectHistoryManagerGets the last viewed project that the user visted and still has permission to see. This method also performs permission checks against the project to ensure that user can see it.- Specified by:
getCurrentProjectin interfaceUserProjectHistoryManager- Parameters:
permission- the permission the user must have for the projectuser- The user to get teh history for.- Returns:
- the last project the use visited.
-
getProjectHistoryWithoutPermissionChecks
Description copied from interface:UserProjectHistoryManagerRetreive the user's project history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs no permission checks. And is extremely fast.- Specified by:
getProjectHistoryWithoutPermissionChecksin interfaceUserProjectHistoryManager- Parameters:
user- The user to get the history project items for.- Returns:
- a list of history project items sort by desc lastViewed date.
-
getProjectHistoryWithPermissionChecks
Description copied from interface:UserProjectHistoryManagerRetreive the user's project history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.- Specified by:
getProjectHistoryWithPermissionChecksin interfaceUserProjectHistoryManager- Parameters:
permission- The permission the user must have for the projectuser- The user to get the history project items for.- Returns:
- a list of projects sort by desc lastViewed date.
-
getProjectHistoryWithPermissionChecks
public List<Project> getProjectHistoryWithPermissionChecks(ProjectAction projectAction, ApplicationUser user) Description copied from interface:UserProjectHistoryManagerRetreive the user's project history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.- Specified by:
getProjectHistoryWithPermissionChecksin interfaceUserProjectHistoryManager- Parameters:
projectAction- The projectAction the user must have for the projectuser- The user to get the history project items for.- Returns:
- a list of projects sort by desc lastViewed date.
-