Interface SprintPermissionService

All Known Implementing Classes:
SprintPermissionServiceImpl

public interface SprintPermissionService
Provides sprint permission checking methods

Current permissions:

View: see at least one issue in the sprint OR allowed to see a board owning the sprint

Create/Edit/Delete: Project admin for all projects of issues in sprint OR project admin for all projects of the owning board

  • Method Details

    • canViewSprint

      @Nonnull ServiceOutcome<Boolean> canViewSprint(com.atlassian.jira.user.ApplicationUser user, Sprint sprint)
      Can the user view a given sprint?
    • canCreateSprint

      ServiceResult canCreateSprint(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView)
      Can the user create a sprint given the set of issues?

      This method checks whether the user has the PROJECT_ADMIN permission for all rapid view's project.

    • canCreateSprint

      ServiceResult canCreateSprint(com.atlassian.jira.user.ApplicationUser user, Sprint sprint)
      Can the user create a given sprint.
    • canUpdateSprint

      @Nonnull ServiceResult canUpdateSprint(com.atlassian.jira.user.ApplicationUser user, Sprint sprint)
      Can the user update a sprint.
    • canDeleteSprint

      @Nonnull ServiceResult canDeleteSprint(com.atlassian.jira.user.ApplicationUser user, Sprint sprint)
      Can the user delete a sprint.
    • canPerformGivenChanges

      @Nonnull ServiceResult canPerformGivenChanges(com.atlassian.jira.user.ApplicationUser user, Sprint updatedSprint)
      Does the user have sufficient permissions to perform the sprint update described by updatedSprint.
    • canUpdateDates

      @Nonnull ServiceResult canUpdateDates(com.atlassian.jira.user.ApplicationUser user, Sprint sprint)
      Can the user update sprint dates for the given sprint.
    • canStartStopSprint

      @Nonnull ServiceResult canStartStopSprint(com.atlassian.jira.user.ApplicationUser user, Sprint sprint)
      Can the user start and stop sprints.
    • canUpdateSprints

      @Nonnull ServiceOutcome<Map<Sprint,Boolean>> canUpdateSprints(com.atlassian.jira.user.ApplicationUser user, List<Sprint> sprint)
      Can the user update the given sprints, that is, update, delete, etc.
    • canAddRemoveIssuesToSprint

      @Nonnull ServiceResult canAddRemoveIssuesToSprint(com.atlassian.jira.user.ApplicationUser user, Iterable<com.atlassian.jira.issue.Issue> issues)
      Can the user edit the sprint assignment for a set of issues?

      In order to add/remove issues from a sprint, the user must have schedule permission for all issues

    • hasManageSprintsPermission

      boolean hasManageSprintsPermission(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView)
      Can the user manage sprints in the given board?
    • hasEditSprintsPermission

      boolean hasEditSprintsPermission(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView)
      Check if the given user can edit name and goal of sprints in the given board.
      Since:
      8.21
    • filterVisibleSprints

      Set<Sprint> filterVisibleSprints(com.atlassian.jira.user.ApplicationUser user, Collection<Sprint> sprints, int maxResults)
      For the provided collection of sprints returns its subset which contains sprints visible to the provided user. This method yields the same result as filtering the sprint collection by the canViewSprint(com.atlassian.jira.user.ApplicationUser, com.atlassian.greenhopper.service.sprint.Sprint) method.

      Use it for performance optimization. For example, rather than executing canViewSprint(com.atlassian.jira.user.ApplicationUser, com.atlassian.greenhopper.service.sprint.Sprint) on each collection's element:

       sprints
        .stream()
        .filter(sprint -> service.canViewSprint(user, sprint).getValue())
        .limit(maxResults)
        .collect(Collectors.toSet())
       
      use this method:
       service.filterVisibleSprints(user, sprints, maxResults)
       
      Parameters:
      user - a user whose permission is checked
      sprints - a collection of sprints to test
      Returns:
      a set of sprints visible to the user