public class RefControl extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
canAbandon() |
boolean |
canCreate(org.eclipse.jgit.revwalk.RevWalk rw,
org.eclipse.jgit.revwalk.RevObject object,
boolean existsOnServer)
Determines whether the user can create a new Git ref.
|
boolean |
canDelete()
Determines whether the user can delete the Git ref controlled by this
object.
|
boolean |
canDeleteDrafts() |
boolean |
canEditTopicName() |
boolean |
canForceEditTopicName() |
boolean |
canForceUpdate() |
boolean |
canForgeAuthor() |
boolean |
canForgeCommitter() |
boolean |
canForgeGerritServerIdentity() |
boolean |
canPublishDrafts() |
boolean |
canRead() |
boolean |
canRebase() |
boolean |
canRemoveReviewer() |
boolean |
canSubmit() |
boolean |
canSubmitAs() |
boolean |
canUpdate() |
boolean |
canUpload()
Determines whether the user can upload a change to the ref controlled by
this object.
|
boolean |
canUploadMerges() |
boolean |
canViewDrafts() |
boolean |
canWrite() |
RefControl |
forUser(CurrentUser who) |
CurrentUser |
getCurrentUser() |
List<com.google.gerrit.common.data.PermissionRange> |
getLabelRanges(boolean isChangeOwner)
All value ranges of any allowed label permission.
|
ProjectControl |
getProjectControl() |
com.google.gerrit.common.data.PermissionRange |
getRange(String permission)
The range of permitted values associated with a label permission.
|
com.google.gerrit.common.data.PermissionRange |
getRange(String permission,
boolean isChangeOwner)
The range of permitted values associated with a label permission.
|
String |
getRefName() |
boolean |
isBlocked(String permissionName)
True if the user is blocked from using this permission.
|
boolean |
isOwner()
Is this user a ref owner?
|
static boolean |
isRE(String refPattern) |
boolean |
isVisible()
Can this user see this reference exists?
|
boolean |
isVisibleByRegisteredUsers()
True if this reference is visible by all REGISTERED_USERS
|
static String |
shortestExample(String pattern) |
static dk.brics.automaton.RegExp |
toRegExp(String refPattern) |
static void |
validateRefPattern(String refPattern) |
public String getRefName()
public ProjectControl getProjectControl()
public CurrentUser getCurrentUser()
public RefControl forUser(CurrentUser who)
public boolean isOwner()
public boolean isVisible()
public boolean isVisibleByRegisteredUsers()
public boolean canUpload()
true
if the user specified can upload a change to the Git
refpublic boolean canUploadMerges()
public boolean canRebase()
public boolean canSubmit()
public boolean canSubmitAs()
public boolean canUpdate()
public boolean canForceUpdate()
public boolean canWrite()
public boolean canRead()
public boolean canCreate(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.revwalk.RevObject object, boolean existsOnServer)
rw
- revision pool object
was parsed in.object
- the object the user will start the reference with.existsOnServer
- the object exists on server or not.true
if the user specified can create a new Git refpublic boolean canDelete()
true
if the user specified can delete a Git ref.public boolean canForgeAuthor()
public boolean canForgeCommitter()
public boolean canForgeGerritServerIdentity()
public boolean canAbandon()
public boolean canRemoveReviewer()
public boolean canViewDrafts()
public boolean canPublishDrafts()
public boolean canDeleteDrafts()
public boolean canEditTopicName()
public boolean canForceEditTopicName()
public List<com.google.gerrit.common.data.PermissionRange> getLabelRanges(boolean isChangeOwner)
public com.google.gerrit.common.data.PermissionRange getRange(String permission)
public com.google.gerrit.common.data.PermissionRange getRange(String permission, boolean isChangeOwner)
public boolean isBlocked(String permissionName)
public static boolean isRE(String refPattern)
public static dk.brics.automaton.RegExp toRegExp(String refPattern)
public static void validateRefPattern(String refPattern) throws com.google.gerrit.common.errors.InvalidNameException
com.google.gerrit.common.errors.InvalidNameException