Enum Class GlobalPermission
- All Implemented Interfaces:
GerritPermission
,GlobalOrPluginPermission
,Serializable
,Comparable<GlobalPermission>
,java.lang.constant.Constable
Global server permissions built into Gerrit.
See also GlobalCapability
which lists the equivalent strings used in the
refs/meta/config settings in All-Projects.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionA description in the context of an exception message.static Set<GlobalOrPluginPermission>
fromAnnotation
(Class<?> clazz) static Set<GlobalOrPluginPermission>
fromAnnotation
(String pluginName, Class<?> clazz) Extracts the@RequiresCapability
or@RequiresAnyCapability
annotation.static GlobalPermission
Returns the enum constant of this class with the specified name.static GlobalPermission[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ACCESS_DATABASE
-
ADMINISTRATE_SERVER
-
CREATE_ACCOUNT
-
CREATE_GROUP
-
CREATE_PROJECT
-
EMAIL_REVIEWERS
-
FLUSH_CACHES
-
KILL_TASK
-
MAINTAIN_SERVER
-
MODIFY_ACCOUNT
-
READ_AS
-
RUN_AS
-
RUN_GC
-
STREAM_EVENTS
-
VIEW_ACCESS
-
VIEW_ALL_ACCOUNTS
-
VIEW_CACHES
-
VIEW_CONNECTIONS
-
VIEW_PLUGINS
-
VIEW_QUEUE
-
VIEW_SECONDARY_EMAILS
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromAnnotation
public static Set<GlobalOrPluginPermission> fromAnnotation(String pluginName, Class<?> clazz) throws PermissionBackendException Extracts the@RequiresCapability
or@RequiresAnyCapability
annotation.- Parameters:
pluginName
- name of the declaring plugin. May benull
or"gerrit"
for classes originating from the core server.clazz
- target class to extract annotation from.- Returns:
- empty set if no annotations were found, or a collection of permissions, any of which are suitable to enable access.
- Throws:
PermissionBackendException
- the annotation could not be parsed.
-
fromAnnotation
public static Set<GlobalOrPluginPermission> fromAnnotation(Class<?> clazz) throws PermissionBackendException - Throws:
PermissionBackendException
-
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
-