Class LabelPermission
- java.lang.Object
-
- com.google.gerrit.server.permissions.LabelPermission
-
- All Implemented Interfaces:
GerritPermission
,ChangePermissionOrLabel
public class LabelPermission extends Object implements ChangePermissionOrLabel
Permission representing a label.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LabelPermission.ForUser
static class
LabelPermission.WithValue
ALabelPermission
at a specific value.
-
Constructor Summary
Constructors Constructor Description LabelPermission(LabelType type)
Construct a reference to a label permission.LabelPermission(LabelPermission.ForUser forUser, LabelType type)
Construct a reference to a label permission.LabelPermission(LabelPermission.ForUser forUser, String name)
Construct a reference to a label permission.LabelPermission(String name)
Construct a reference to a label permission.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
describeForException()
A description in the context of an exception message.boolean
equals(Object other)
LabelPermission.ForUser
forUser()
int
hashCode()
String
label()
String
toString()
-
-
-
Constructor Detail
-
LabelPermission
public LabelPermission(LabelType type)
Construct a reference to a label permission.- Parameters:
type
- type description of the label.
-
LabelPermission
public LabelPermission(LabelPermission.ForUser forUser, LabelType type)
Construct a reference to a label permission.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.type
- type description of the label.
-
LabelPermission
public LabelPermission(String name)
Construct a reference to a label permission.- Parameters:
name
- name of the label, e.g."Code-Review"
or"Verified"
.
-
LabelPermission
public LabelPermission(LabelPermission.ForUser forUser, String name)
Construct a reference to a label permission.- Parameters:
forUser
-SELF
(default) orON_BEHALF_OF
for labelAs behavior.name
- name of the label, e.g."Code-Review"
or"Verified"
.
-
-
Method Detail
-
forUser
public LabelPermission.ForUser forUser()
- Returns:
SELF
orON_BEHALF_OF
(or labelAs).
-
label
public String label()
- Returns:
- name of the label, e.g.
"Code-Review"
.
-
describeForException
public String describeForException()
Description copied from interface:GerritPermission
A description in the context of an exception message.Should be grammatical when used in the construction "not permitted: [description] on [resource]", although individual
PermissionBackend
implementations may vary the wording.- Specified by:
describeForException
in interfaceGerritPermission
-
-