Enum ProjectPermission
- java.lang.Object
-
- java.lang.Enum<ProjectPermission>
-
- com.google.gerrit.server.permissions.ProjectPermission
-
- All Implemented Interfaces:
Serializable
,Comparable<ProjectPermission>
public enum ProjectPermission extends Enum<ProjectPermission>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCESS
Can access at least one reference or change within the repository.CREATE_CHANGE
Can create at least one change in the project.CREATE_REF
Can create at least one reference in the project.CREATE_TAG_REF
Can create at least one tag reference in the project.READ
Can read all references in the repository.READ_NO_CONFIG
Can read all non-config references in the repository.RUN_RECEIVE_PACK
Can run receive pack.RUN_UPLOAD_PACK
Can run upload pack.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
describeForException()
Optional<String>
permissionName()
static ProjectPermission
valueOf(String name)
Returns the enum constant of this type with the specified name.static ProjectPermission[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ACCESS
public static final ProjectPermission ACCESS
Can access at least one reference or change within the repository.Checking this permission instead of
READ
may require filtering to hide specific references or changes, which can be expensive.
-
READ
public static final ProjectPermission READ
Can read all references in the repository.This is a stronger form of
ACCESS
where no filtering is required.
-
READ_NO_CONFIG
public static final ProjectPermission READ_NO_CONFIG
Can read all non-config references in the repository.This is the same as
READ
but does not check if they user can see refs/meta/config. Therefore, callers should checkREAD
before excluding config refs in a short-circuit.
-
CREATE_REF
public static final ProjectPermission CREATE_REF
Can create at least one reference in the project.This project level permission only validates the user may create some type of reference within the project. The exact reference name must be checked at creation:
permissionBackend .user(user) .project(proj) .ref(ref) .check(RefPermission.CREATE);
-
CREATE_TAG_REF
public static final ProjectPermission CREATE_TAG_REF
Can create at least one tag reference in the project.This project level permission only validates the user may create some tag reference within the project. The exact reference name must be checked at creation:
permissionBackend .user(user) .project(proj) .ref(ref) .check(RefPermission.CREATE);
-
CREATE_CHANGE
public static final ProjectPermission CREATE_CHANGE
Can create at least one change in the project.This project level permission only validates the user may create a change for some branch within the project. The exact reference name must be checked at creation:
permissionBackend .user(user) .project(proj) .ref(ref) .check(RefPermission.CREATE_CHANGE);
-
RUN_RECEIVE_PACK
public static final ProjectPermission RUN_RECEIVE_PACK
Can run receive pack.
-
RUN_UPLOAD_PACK
public static final ProjectPermission RUN_UPLOAD_PACK
Can run upload pack.
-
-
Method Detail
-
values
public static ProjectPermission[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ProjectPermission c : ProjectPermission.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProjectPermission valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
permissionName
public Optional<String> permissionName()
- Returns:
- name used in
project.config
permissions.
-
describeForException
public String describeForException()
-
-