Package com.google.gerrit.server.project
Class RefControl
- java.lang.Object
-
- com.google.gerrit.server.project.RefControl
-
public class RefControl extends Object
Manages access control for Git references (aka branches, tags).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RefControl
forUser(CurrentUser who)
ProjectControl
getProjectControl()
String
getRefName()
CurrentUser
getUser()
boolean
hasReadPermissionOnRef(boolean allowNoteDbRefs)
Returnstrue
if the user has permission to read the ref.boolean
isBlocked(String permissionName)
True if the user is blocked from using this permission.boolean
isEditVisible()
Can this user see other users change edits?boolean
isOwner()
Is this user a ref owner?
-
-
-
Method Detail
-
getRefName
public String getRefName()
-
getProjectControl
public ProjectControl getProjectControl()
-
getUser
public CurrentUser getUser()
-
forUser
public RefControl forUser(CurrentUser who)
-
isOwner
public boolean isOwner()
Is this user a ref owner?
-
hasReadPermissionOnRef
public boolean hasReadPermissionOnRef(boolean allowNoteDbRefs)
Returnstrue
if the user has permission to read the ref. This method evaluatesRefPermission.READ
only. Hence, it is not authoritative. For example, it does not tell if the user can see NoteDb refs such asrefs/meta/external-ids
which requiresGlobalPermission#ACCESS_DATABASE
and deny access in this case.
-
isEditVisible
public boolean isEditVisible()
Can this user see other users change edits?
-
isBlocked
public boolean isBlocked(String permissionName)
True if the user is blocked from using this permission.
-
-