public class

IsPersonalRepositoryCondition

extends Object
implements Condition
java.lang.Object
   ↳ com.atlassian.bitbucket.web.conditions.IsPersonalRepositoryCondition

Class Overview

A condition for determining whether a given repository resides in a personal project; ergo, it is a personal repository.

By default, repositories in any personal project will match this condition. Setting the onlyMine parameter to true restricts the condition to only return true if the repository is in the current user's PersonalProject personal project.

Summary

Constants
String ONLY_MINE
String REPOSITORY
Public Constructors
IsPersonalRepositoryCondition(AuthenticationContext authenticationContext)
Public Methods
void init(Map<StringString> params)
Parses parameters for this condition.
boolean shouldDisplay(Map<StringObject> context)
Retrieves a flag indicating whether the repository, which is expected to be present in the provided context under the key "repository", belongs to a personal project.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.web.Condition

Constants

public static final String ONLY_MINE

Constant Value: "onlyMine"

public static final String REPOSITORY

Constant Value: "repository"

Public Constructors

public IsPersonalRepositoryCondition (AuthenticationContext authenticationContext)

Public Methods

public void init (Map<StringString> params)

Parses parameters for this condition. Supported parameters are:

  • onlyMine: true if the condition should only match the current user's personal project; false if all personal project should match (Default: false)

Parameters
params configuration parameters for this condition

public boolean shouldDisplay (Map<StringObject> context)

Retrieves a flag indicating whether the repository, which is expected to be present in the provided context under the key "repository", belongs to a personal project.

If onlyMine is set to true, the repository must not only belong to a personal project but must belong to the current user's personal project.

Parameters
context the context containing the repository
Returns
  • true if the repository is in a personal project (optionally further restricted to only the current user's personal project); otherwise, false