Enum Class ChangePermission

java.lang.Object
java.lang.Enum<ChangePermission>
com.google.gerrit.server.permissions.ChangePermission
All Implemented Interfaces:
GerritPermission, ChangePermissionOrLabel, Serializable, Comparable<ChangePermission>, java.lang.constant.Constable

public enum ChangePermission extends Enum<ChangePermission> implements ChangePermissionOrLabel
  • Enum Constant Details

    • READ

      public static final ChangePermission READ
    • RESTORE

      public static final ChangePermission RESTORE
      The change can't be restored if its current patch set is locked.

      Before checking this permission, the caller should first verify the current patch set of the change is not locked by calling PatchSetUtil.isPatchSetLocked.

    • DELETE

      public static final ChangePermission DELETE
    • ABANDON

      public static final ChangePermission ABANDON
      The change can't be abandoned if its current patch set is locked.

      Before checking this permission, the caller should first verify the current patch set of the change is not locked by calling PatchSetUtil.isPatchSetLocked.

    • EDIT_DESCRIPTION

      public static final ChangePermission EDIT_DESCRIPTION
    • EDIT_CUSTOM_KEYED_VALUES

      public static final ChangePermission EDIT_CUSTOM_KEYED_VALUES
    • EDIT_HASHTAGS

      public static final ChangePermission EDIT_HASHTAGS
    • EDIT_TOPIC_NAME

      public static final ChangePermission EDIT_TOPIC_NAME
    • REMOVE_REVIEWER

      public static final ChangePermission REMOVE_REVIEWER
    • ADD_PATCH_SET

      public static final ChangePermission ADD_PATCH_SET
      A new patch set can't be added if the patch set is locked for the change.

      Before checking this permission, the caller should first verify the current patch set of the change is not locked by calling PatchSetUtil.isPatchSetLocked.

    • REBASE

      public static final ChangePermission REBASE
      The change can't be rebased if its current patch set is locked.

      Before checking this permission, the caller should first verify the current patch set of the change is not locked by calling PatchSetUtil.isPatchSetLocked.

    • REBASE_ON_BEHALF_OF_UPLOADER

      public static final ChangePermission REBASE_ON_BEHALF_OF_UPLOADER
      Permission that is required for a user to rebase a change on behalf of the uploader.

      This only covers the permissions of the rebaser (aka the impersonating user).

      In addition rebase on behalf of the uploader requires the uploader (aka the impersonated user) to have permissions to create the new patch set. These permissions need to be checked separately.

    • REVERT

      public static final ChangePermission REVERT
    • SUBMIT

      public static final ChangePermission SUBMIT
    • SUBMIT_AS

      public static final ChangePermission SUBMIT_AS
    • TOGGLE_WORK_IN_PROGRESS_STATE

      public static final ChangePermission TOGGLE_WORK_IN_PROGRESS_STATE
  • Method Details

    • values

      public static ChangePermission[] 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

      public static ChangePermission valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • 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 interface GerritPermission
    • hintForException

      public Optional<String> hintForException()
      Description copied from interface: ChangePermissionOrLabel
      A hint that explains under which conditions this permission is permitted.

      This is useful for permissions that are not directly assigned but are indirectly permitted by the user having other permissions or being the change owner.

      Specified by:
      hintForException in interface ChangePermissionOrLabel