public class IsPersonalRepositoryCondition extends Object implements com.atlassian.plugin.web.Condition
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 personal project
.
Modifier and Type | Field and Description |
---|---|
static String |
ONLY_MINE |
static String |
REPOSITORY |
Constructor and Description |
---|
IsPersonalRepositoryCondition(com.atlassian.bitbucket.auth.AuthenticationContext authenticationContext) |
Modifier and Type | Method and Description |
---|---|
void |
init(Map<String,String> params)
Parses parameters for this condition.
|
boolean |
shouldDisplay(Map<String,Object> 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. |
public static final String REPOSITORY
public static final String ONLY_MINE
public IsPersonalRepositoryCondition(com.atlassian.bitbucket.auth.AuthenticationContext authenticationContext)
public void init(Map<String,String> params)
onlyMine
: true
if the condition should only match the current user's personal project;
false
if all personal project should match (Default: false
)init
in interface com.atlassian.plugin.web.Condition
params
- configuration parameters for this conditionpublic boolean shouldDisplay(Map<String,Object> context)
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.
shouldDisplay
in interface com.atlassian.plugin.web.Condition
context
- the context containing the repositorytrue
if the repository is in a personal project (optionally further restricted to only
the current user's personal project); otherwise, false
Copyright © 2019 Atlassian. All rights reserved.