public class RefControl
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
canAbandon() |
boolean |
canCreate(com.google.gerrit.reviewdb.server.ReviewDb db,
org.eclipse.jgit.revwalk.RevWalk rw,
org.eclipse.jgit.revwalk.RevObject object)
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 |
canEditHashtags() |
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() |
java.util.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(java.lang.String permission)
The range of permitted values associated with a label permission.
|
com.google.gerrit.common.data.PermissionRange |
getRange(java.lang.String permission,
boolean isChangeOwner)
The range of permitted values associated with a label permission.
|
java.lang.String |
getRefName() |
boolean |
isBlocked(java.lang.String permissionName)
True if the user is blocked from using this permission.
|
boolean |
isOwner()
Is this user a ref owner?
|
static boolean |
isRE(java.lang.String refPattern) |
boolean |
isVisible()
Can this user see this reference exists?
|
boolean |
isVisibleByRegisteredUsers()
True if this reference is visible by all REGISTERED_USERS
|
static java.lang.String |
shortestExample(java.lang.String pattern) |
static dk.brics.automaton.RegExp |
toRegExp(java.lang.String refPattern) |
static void |
validateRefPattern(java.lang.String refPattern) |
public java.lang.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(com.google.gerrit.reviewdb.server.ReviewDb db, org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.revwalk.RevObject object)
db
- db for checking change visibility.rw
- revision pool object
was parsed in; must be reset before
calling this method.object
- the object the user will start the reference with.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 canEditHashtags()
public boolean canForceEditTopicName()
public java.util.List<com.google.gerrit.common.data.PermissionRange> getLabelRanges(boolean isChangeOwner)
public com.google.gerrit.common.data.PermissionRange getRange(java.lang.String permission)
public com.google.gerrit.common.data.PermissionRange getRange(java.lang.String permission, boolean isChangeOwner)
public boolean isBlocked(java.lang.String permissionName)
public static boolean isRE(java.lang.String refPattern)
public static java.lang.String shortestExample(java.lang.String pattern)
public static dk.brics.automaton.RegExp toRegExp(java.lang.String refPattern)
public static void validateRefPattern(java.lang.String refPattern) throws com.google.gerrit.common.errors.InvalidNameException
com.google.gerrit.common.errors.InvalidNameException