Package org.gitlab4j.api.utils
Enum AccessTokenUtils.Scope
- java.lang.Object
-
- java.lang.Enum<AccessTokenUtils.Scope>
-
- org.gitlab4j.api.utils.AccessTokenUtils.Scope
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AccessTokenUtils.Scope>
- Enclosing class:
- AccessTokenUtils
public static enum AccessTokenUtils.Scope extends java.lang.Enum<AccessTokenUtils.Scope>
This enum defines the available scopes for a personal access token.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description API
Grants complete access to the API and Container Registry (read/write) (introduced in GitLab 8.15).READ_REGISTRY
Allows to read (pull) container registry images if a project is private and authorization is required (introduced in GitLab 9.3).READ_REPOSITORY
Allows read-only access (pull) to the repository through git clone.READ_USER
Allows access to the read-only endpoints under /users.SUDO
Allows performing API actions as any user in the system, if the authenticated user is an admin (introduced in GitLab 10.2).WRITE_REPOSITORY
Grants read-write access to repositories on private projects using Git-over-HTTP (not using the API).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AccessTokenUtils.Scope
forValue(java.lang.String value)
java.lang.String
toString()
java.lang.String
toValue()
static AccessTokenUtils.Scope
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AccessTokenUtils.Scope[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
API
public static final AccessTokenUtils.Scope API
Grants complete access to the API and Container Registry (read/write) (introduced in GitLab 8.15).
-
READ_REGISTRY
public static final AccessTokenUtils.Scope READ_REGISTRY
Allows to read (pull) container registry images if a project is private and authorization is required (introduced in GitLab 9.3). If the GitLab server you are using does not have the Registry properly configured, using this scope will result in an exception.
-
READ_REPOSITORY
public static final AccessTokenUtils.Scope READ_REPOSITORY
Allows read-only access (pull) to the repository through git clone.
-
READ_USER
public static final AccessTokenUtils.Scope READ_USER
Allows access to the read-only endpoints under /users. Essentially, any of the GET requests in the Users API are allowed (introduced in GitLab 8.15).
-
SUDO
public static final AccessTokenUtils.Scope SUDO
Allows performing API actions as any user in the system, if the authenticated user is an admin (introduced in GitLab 10.2).
-
WRITE_REPOSITORY
public static final AccessTokenUtils.Scope WRITE_REPOSITORY
Grants read-write access to repositories on private projects using Git-over-HTTP (not using the API).
-
-
Method Detail
-
values
public static AccessTokenUtils.Scope[] 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 (AccessTokenUtils.Scope c : AccessTokenUtils.Scope.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AccessTokenUtils.Scope valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
forValue
public static AccessTokenUtils.Scope forValue(java.lang.String value)
-
toValue
public java.lang.String toValue()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<AccessTokenUtils.Scope>
-
-