Class GlobalCapability


  • public class GlobalCapability
    extends Object
    Server wide capabilities. Represented as Permission objects.
    • Field Detail

      • ACCESS_DATABASE

        public static final String ACCESS_DATABASE
        Ability to view code review metadata refs in repositories.
        See Also:
        Constant Field Values
      • ADMINISTRATE_SERVER

        public static final String ADMINISTRATE_SERVER
        Denotes the server's administrators.

        This is similar to UNIX root, or Windows SYSTEM account. Any user that has this capability can perform almost any other action, or can grant themselves the power to perform any other action on the site. Most of the other capabilities and permissions fall-back to the predicate "OR user has capability ADMINISTRATE_SERVER".

        See Also:
        Constant Field Values
      • BATCH_CHANGES_LIMIT

        public static final String BATCH_CHANGES_LIMIT
        Maximum number of changes that may be pushed in a batch.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_BATCH_CHANGES_LIMIT

        public static final int DEFAULT_MAX_BATCH_CHANGES_LIMIT
        Default maximum number of changes that may be pushed in a batch, 0 means no limit. This is just used as a suggestion for prepopulating the field in the access UI.
        See Also:
        Constant Field Values
      • EMAIL_REVIEWERS

        public static final String EMAIL_REVIEWERS
        Denotes who may email change reviewers and watchers.

        This can be used to deny build bots from emailing reviewers and people who watch the change. Instead, only the authors of the change and those who starred it will be emailed. The allow rules are evaluated before deny rules, however the default is to allow emailing, if no explicit rule is matched.

        See Also:
        Constant Field Values
      • FLUSH_CACHES

        public static final String FLUSH_CACHES
        Can flush any cache except the active web_sessions cache.
        See Also:
        Constant Field Values
      • MAINTAIN_SERVER

        public static final String MAINTAIN_SERVER
        Can perform limited server maintenance.

        Includes tasks such as reindexing changes and flushing caches that may need to be performed regularly. Does not grant arbitrary read/write/ACL management permissions as does ADMINISTRATE_SERVER.

        See Also:
        Constant Field Values
      • DEFAULT_MAX_QUERY_LIMIT

        public static final int DEFAULT_MAX_QUERY_LIMIT
        Default result limit per executed query.
        See Also:
        Constant Field Values
      • READ_AS

        public static final String READ_AS
        Can impersonate any user to see which refs they can read.
        See Also:
        Constant Field Values
      • VIEW_ALL_ACCOUNTS

        public static final String VIEW_ALL_ACCOUNTS
        Can view all accounts, regardless of accounts.visibility.
        See Also:
        Constant Field Values
      • VIEW_CONNECTIONS

        public static final String VIEW_CONNECTIONS
        Can view open connections to the server's SSH port.
        See Also:
        Constant Field Values
      • VIEW_QUEUE

        public static final String VIEW_QUEUE
        Can view all pending tasks in the queue (not just the filtered set).
        See Also:
        Constant Field Values
      • VIEW_ACCESS

        public static final String VIEW_ACCESS
        Can query permissions for any (project, user) pair
        See Also:
        Constant Field Values
    • Method Detail

      • getAllNames

        public static Collection<String> getAllNames()
        Returns:
        all valid capability names.
      • isGlobalCapability

        public static boolean isGlobalCapability​(String varName)
        Returns:
        true if the name is recognized as a capability name.
      • hasRange

        public static boolean hasRange​(String varName)
        Returns:
        true if the capability should have a range attached.
      • getRangeNames

        public static List<String> getRangeNames()