Class ProjectService

java.lang.Object
com.atlassian.jira.projects.ProjectService

@Component("ProjectServiceWrapper") public class ProjectService extends Object
A wrapper around ProjectService that returns Eithers. We must pass a name to the @Component annotation to avoid conflicting with JIRA's ProjectService.
  • Constructor Details

  • Method Details

    • currentUserCanAdministerProject

      public boolean currentUserCanAdministerProject(String key)
      Determine whether the current user can administer a project.
      Parameters:
      key - A project key.
      Returns:
      true if the current user can administer the project, otherwise false.
    • getProject

      public io.atlassian.fugue.Either<ErrorCollection,Project> getProject(String key)
      Retrieve a project as the current user. Retrieval can fail if the project doesn't exist or the current user doesn't have permission to view it.
      Parameters:
      key - A project key.
      Returns:
      The specified project or an error collection.
    • getProject

      public io.atlassian.fugue.Either<ErrorCollection,Project> getProject(long id)
      Retrieve a project as the current user. Retrieval can fail if the project doesn't exist or the current user doesn't have permission to view it.
      Parameters:
      id - A project id.
      Returns:
      The specified project or an error collection.