Package com.google.gerrit.common.data
Class Permission
- java.lang.Object
-
- com.google.gerrit.common.data.Permission
-
- All Implemented Interfaces:
Comparable<Permission>
public class Permission extends Object implements Comparable<Permission>
A single permission within anAccessSection
of a project.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ABANDON
static String
ADD_PATCH_SET
static String
CREATE
static String
CREATE_SIGNED_TAG
static String
CREATE_TAG
static String
DELETE
static String
DELETE_CHANGES
static String
DELETE_OWN_CHANGES
static String
EDIT_ASSIGNEE
static String
EDIT_HASHTAGS
static String
EDIT_TOPIC_NAME
protected boolean
exclusiveGroup
static String
FORGE_AUTHOR
static String
FORGE_COMMITTER
static String
FORGE_SERVER
static String
LABEL
static String
LABEL_AS
protected String
name
static String
OWNER
static String
PUSH
static String
PUSH_MERGE
static String
READ
static String
REBASE
static String
REMOVE_REVIEWER
static String
REVERT
protected List<PermissionRule>
rules
static String
SUBMIT
static String
SUBMIT_AS
static String
TOGGLE_WORK_IN_PROGRESS_STATE
static String
VIEW_PRIVATE_CHANGES
-
Constructor Summary
Constructors Modifier Constructor Description protected
Permission()
Permission(String name)
-
Method Summary
-
-
-
Field Detail
-
ABANDON
public static final String ABANDON
- See Also:
- Constant Field Values
-
ADD_PATCH_SET
public static final String ADD_PATCH_SET
- See Also:
- Constant Field Values
-
CREATE
public static final String CREATE
- See Also:
- Constant Field Values
-
CREATE_SIGNED_TAG
public static final String CREATE_SIGNED_TAG
- See Also:
- Constant Field Values
-
CREATE_TAG
public static final String CREATE_TAG
- See Also:
- Constant Field Values
-
DELETE
public static final String DELETE
- See Also:
- Constant Field Values
-
DELETE_CHANGES
public static final String DELETE_CHANGES
- See Also:
- Constant Field Values
-
DELETE_OWN_CHANGES
public static final String DELETE_OWN_CHANGES
- See Also:
- Constant Field Values
-
EDIT_ASSIGNEE
public static final String EDIT_ASSIGNEE
- See Also:
- Constant Field Values
-
EDIT_HASHTAGS
public static final String EDIT_HASHTAGS
- See Also:
- Constant Field Values
-
EDIT_TOPIC_NAME
public static final String EDIT_TOPIC_NAME
- See Also:
- Constant Field Values
-
FORGE_AUTHOR
public static final String FORGE_AUTHOR
- See Also:
- Constant Field Values
-
FORGE_COMMITTER
public static final String FORGE_COMMITTER
- See Also:
- Constant Field Values
-
FORGE_SERVER
public static final String FORGE_SERVER
- See Also:
- Constant Field Values
-
LABEL
public static final String LABEL
- See Also:
- Constant Field Values
-
LABEL_AS
public static final String LABEL_AS
- See Also:
- Constant Field Values
-
OWNER
public static final String OWNER
- See Also:
- Constant Field Values
-
PUSH
public static final String PUSH
- See Also:
- Constant Field Values
-
PUSH_MERGE
public static final String PUSH_MERGE
- See Also:
- Constant Field Values
-
READ
public static final String READ
- See Also:
- Constant Field Values
-
REBASE
public static final String REBASE
- See Also:
- Constant Field Values
-
REMOVE_REVIEWER
public static final String REMOVE_REVIEWER
- See Also:
- Constant Field Values
-
REVERT
public static final String REVERT
- See Also:
- Constant Field Values
-
SUBMIT
public static final String SUBMIT
- See Also:
- Constant Field Values
-
SUBMIT_AS
public static final String SUBMIT_AS
- See Also:
- Constant Field Values
-
TOGGLE_WORK_IN_PROGRESS_STATE
public static final String TOGGLE_WORK_IN_PROGRESS_STATE
- See Also:
- Constant Field Values
-
VIEW_PRIVATE_CHANGES
public static final String VIEW_PRIVATE_CHANGES
- See Also:
- Constant Field Values
-
name
protected String name
-
exclusiveGroup
protected boolean exclusiveGroup
-
rules
protected List<PermissionRule> rules
-
-
Constructor Detail
-
Permission
protected Permission()
-
Permission
public Permission(String name)
-
-
Method Detail
-
isPermission
public static boolean isPermission(String varName)
- Returns:
- true if the name is recognized as a permission name.
-
hasRange
public static boolean hasRange(String varName)
-
isLabel
public static boolean isLabel(String varName)
- Returns:
- true if the permission name is actually for a review label.
-
isLabelAs
public static boolean isLabelAs(String var)
- Returns:
- true if the permission is for impersonated review labels.
-
forLabel
public static String forLabel(String labelName)
- Returns:
- permission name for the given review label.
-
forLabelAs
public static String forLabelAs(String labelName)
- Returns:
- permission name to apply a label for another user.
-
getName
public String getName()
-
getLabel
public String getLabel()
-
getExclusiveGroup
public boolean getExclusiveGroup()
-
setExclusiveGroup
public void setExclusiveGroup(boolean newExclusiveGroup)
-
getRules
public com.google.common.collect.ImmutableList<PermissionRule> getRules()
-
setRules
public void setRules(List<PermissionRule> list)
-
add
public void add(PermissionRule rule)
-
remove
public void remove(PermissionRule rule)
-
removeRule
public void removeRule(GroupReference group)
-
clearRules
public void clearRules()
-
getRule
public PermissionRule getRule(GroupReference group)
-
getRule
public PermissionRule getRule(GroupReference group, boolean create)
-
compareTo
public int compareTo(Permission b)
- Specified by:
compareTo
in interfaceComparable<Permission>
-
-