blob: 57e7bf7f69a08fd871a54934b89e5f78b05c08a9 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Access Controls
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08002
3Access controls in Gerrit are group based. Every user account is a
4member of one or more groups, and access and privileges are granted
Matt Fischer620255a2011-03-22 14:28:23 -05005to those groups. Access rights cannot be granted to individual
6users.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08007
8
Edwin Kempin4bf01962014-04-16 16:47:10 +02009[[system_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080010== System Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080011
Anita Kuno178f64b2014-04-22 18:52:28 -040012Gerrit comes with the following system groups:
Khai Do4245e6f2013-10-11 18:14:31 +020013
Khai Do4245e6f2013-10-11 18:14:31 +020014* Anonymous Users
15* Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020016* Project Owners
17* Registered Users
18
19The system groups are assigned special access and membership management
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -070020privileges.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080021
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020022
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010023[[anonymous_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080024=== Anonymous Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080025
26All users are automatically a member of this group. Users who are
27not signed in are a member of only this group, and no others.
28
29Any access rights assigned to this group are inherited by all users.
30
31Administrators and project owners can grant access rights to this
32group in order to permit anonymous users to view project changes,
33without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010034to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080035identity for all other operations.
36
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020037
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010038[[project_owners]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080039=== Project Owners
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010040
41Access rights assigned to this group are always evaluated within the
42context of a project to which the access rights apply. These rights
43therefore apply to all the users who are owners of this project.
44
45By assigning access rights to this group on a parent project Gerrit
46administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010047<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010048access rights where they are resolved to the users that own the child
49project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010050<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010051avoid the need to initially configure access rights for
52newly created child projects.
53
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020054
Khai Do4245e6f2013-10-11 18:14:31 +020055[[change_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080056=== Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020057
58Access rights assigned to this group are always evaluated within the
59context of a change to which the access rights apply. These rights
60therefore apply to the user who is the owner of this change.
61
62It is typical to assign a label to this group, allowing the change
63owner to vote on his change, but not actually cause it to become
64approved or rejected.
65
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010066[[registered_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080067=== Registered Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080068
69All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +010070also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080071
72Any access rights assigned to this group are inherited by all
73users as soon as they sign-in to Gerrit. If OpenID authentication
74is being employed, moving from only 'Anonymous Users' into this
75group is very easy. Caution should be taken when assigning any
76permissions to this group.
77
Dave Borowitz01c1b1f2013-02-27 13:49:04 -080078It is typical to assign `Code-Review -1..+1` to this group,
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080079allowing signed-in users to vote on a change, but not actually
80cause it to become approved or rejected.
81
82Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010083on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080084
85
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -070086== Predefined Groups
87
88Predefined groups differs from system groups by the fact that they
89exist in the ACCOUNT_GROUPS table (like normal groups) but predefined groups
90are created on Gerrit site initialization and unique UUIDs are assigned
91to those groups. These UUIDs are different on different Gerrit sites.
92
93Gerrit comes with two predefined groups:
94
95* Administrators
96* Non-Interactive Users
97
98
99[[administrators]]
100=== Administrators
101
102This is the Gerrit "root" identity. The capability
103link:access-control.html#capability_administrateServer['Administrate Server']
104is assigned to this predefined group on Gerrit site creation.
105
106Users in the 'Administrators' group can perform any action under
107the Admin menu, to any group or project, without further validation
108or any other access controls. In most installations only those
109users who have direct filesystem and database access would be
110placed into this group.
111
112Membership in the 'Administrators' group does not imply any other
113access rights. Administrators do not automatically get code review
114approval or submit rights in projects. This is a feature designed
115to permit administrative users to otherwise access Gerrit as any
116other normal user would, without needing two different accounts.
117
118
119[[non-interactive_users]]
120=== Non-Interactive Users
121
122This is the Gerrit "batch" identity. The capabilities
123link:access-control.html#capability_priority['Priority BATCH'] and
124link:access-control.html#capability_streamEvents['Stream Events']
125are assigned to this predefined group on Gerrit site creation.
126
127The members of this group are not expected to perform interactive
128operations on the Gerrit web front-end.
129
130However, sometimes such a user may need a separate thread pool in
131order to prevent it from grabbing threads from the interactive users.
132
133These users live in a second thread pool, which separates operations
134made by the non-interactive users from the ones made by the interactive
135users. This ensures that the interactive users can keep working when
136resources are tight.
137
138
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800139== Account Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800140
141Account groups contain a list of zero or more user account members,
142added individually by a group owner. Any user account listed as
143a group member is given any access rights granted to the group.
144
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800145Every group has one other group designated as its owner. Users who
146are members of the owner group can:
147
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100148* Add users and other groups to this group
149* Remove users and other groups from this group
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800150* Change the name of this group
151* Change the description of this group
152* Change the owner of this group, to another group
153
154It is permissible for a group to own itself, allowing the group
155members to directly manage who their peers are.
156
157Newly created groups are automatically created as owning themselves,
158with the creating user as the only member. This permits the group
159creator to add additional members, and change the owner to another
160group if desired.
161
162It is somewhat common to create two groups at the same time,
163for example `Foo` and `Foo-admin`, where the latter group
164`Foo-admin` owns both itself and also group `Foo`. Users who
165are members of `Foo-admin` can thus control the membership of
166`Foo`, without actually having the access rights granted to `Foo`.
167This configuration can help prevent accidental submits when the
168members of `Foo` have submit rights on a project, and the members of
169`Foo-admin` typically do not need to have such rights.
170
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200171
Thanh Ha6eed43f2013-04-11 21:03:55 -0400172[[ldap_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800173== LDAP Groups
Thanh Ha6eed43f2013-04-11 21:03:55 -0400174
175LDAP groups are Account Groups that are maintained inside of your
176LDAP instance. If you are using LDAP to manage your groups they will
177not appear in the Groups list. However you can use them just like
178regular Account Groups by prefixing your group with "ldap/" in the
179Access Control for a project. For example "ldap/foo-project" will
180add the LDAP "foo-project" group to the access list.
181
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800182
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800183== Project Access Control Lists
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800184
lincolnfa7bdd32010-04-22 14:23:05 -0300185A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700186project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300187through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800188
189Per-project access control lists are also supported.
190
191Users are permitted to use the maximum range granted to any of their
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800192groups on a label. For example, a user is a member of `Foo Leads`, and
193the following ACLs are granted on a project:
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800194
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100195[options="header"]
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800196|===================================================
197|Group |Reference Name |Label |Range
198|Anonymous Users |refs/heads/* |Code-Review|-1..+1
199|Registered Users|refs/heads/* |Code-Review|-1..+2
200|Foo Leads |refs/heads/* |Code-Review|-2..0
201|===================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800202
203Then the effective range permitted to be used by the user is
204`-2..+2`, as the user is a member of all three groups (see above
205about the system groups) and the maximum range is chosen (so the
206lowest value granted to any group, and the highest value granted
207to any group).
208
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800209Reference-level access control is also possible.
210
211Permissions can be set on a single reference name to match one
212branch (e.g. `refs/heads/master`), or on a reference namespace
Jonathan Nieder5758f182015-03-30 11:28:55 -0700213(e.g. `+refs/heads/*+`) to match any branch starting with that
214prefix. So a permission with `+refs/heads/*+` will match
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800215`refs/heads/master` and `refs/heads/experimental`, etc.
216
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700217Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200218by prefixing the reference name with `^`. For example
219`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700220between 1 and 8 characters long. Within a regular expression `.`
221is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100222The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
223is used for evaluation of regular expression access control
224rules. See the library documentation for details on this
Doug Claare852eb32016-03-18 14:43:28 -0700225particular regular expression flavor. One quirk is that the
226shortest possible pattern expansion must be a valid ref name:
227thus `^refs/heads/.*/name` will fail because `refs/heads//name`
228is not a valid reference, but `^refs/heads/.+/name` will work.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700229
230References can have the current user name automatically included,
231creating dynamic access controls that change to match the currently
232logged in user. For example to provide a personal sandbox space
Jonathan Nieder5758f182015-03-30 11:28:55 -0700233to all developers, `+refs/heads/sandbox/${username}/*+` allowing
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700234the user 'joe' to use 'refs/heads/sandbox/joe/foo'.
235
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800236When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700237the full set of access rights to determine if the user
238is allowed to perform a given action. For example, if a user is a
239member of `Foo Leads`, they are reviewing a change destined for
240the `refs/heads/qa` branch, and the following ACLs are granted
241on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800242
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100243[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100244|===============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800245|Group |Reference Name|Label |Range |Exclusive
246|Registered Users |refs/heads/* |Code-Review| -1..+1 |
247|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
248|QA Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100249|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800250
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700251Then the effective range permitted to be used by the user is
252`-2..+2`, as the user's membership of `Foo Leads` effectively grant
253them access to the entire reference space, thanks to the wildcard.
254
255Gerrit also supports exclusive reference-level access control.
256
257It is possible to configure Gerrit to grant an exclusive ref level
258access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100259an operation on a project/reference pair. This is done by ticking
260the exclusive flag when setting the permission for the
261`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700262
263For example, if a user who is a member of `Foo Leads` tries to
264review a change destined for branch `refs/heads/qa` in a project,
265and the following ACLs are granted:
266
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100267[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100268|==============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800269|Group |Reference Name|Label |Range |Exclusive
270|Registered Users|refs/heads/* |Code-Review| -1..+1 |
271|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
272|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
Fredrik Luthander54abc352012-01-20 16:18:41 +0100273|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700274
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800275Then this user will not have `Code-Review` rights on that change,
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700276since there is an exclusive access right in place for the
277`refs/heads/qa` branch. This allows locking down access for a
278particular branch to a limited set of users, bypassing inherited
279rights and wildcards.
280
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800281In order to grant the ability to `Code-Review` to the members of
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700282`Foo Leads`, in `refs/heads/qa` then the following access rights
283would be needed:
284
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100285[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100286|==============================================================
287|Group |Reference Name|Category |Range |Exclusive
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800288|Registered Users|refs/heads/* |Code-Review| -1..+1 |
289|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
290|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
291|Foo Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100292|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700293
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200294
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800295=== OpenID Authentication
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800296
297If the Gerrit instance is configured to use OpenID authentication,
298an account's effective group membership will be restricted to only
299the `Anonymous Users` and `Registered Users` groups, unless *all*
300of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700301in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800302
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200303
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800304=== All Projects
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800305
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700306Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800307is automatically inherited by every other project in the same
308Gerrit instance. These rights can be seen, but not modified,
309in any other project's `Access` administration tab.
310
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100311Only members of the groups with the `Administrate Server` capability
312may edit the access control list for `All-Projects`. By default this
313capability is given to the group `Administrators`, but can be given
314to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700315
316Ownership of this project cannot be delegated to another group.
317This restriction is by design. Granting ownership to another
318group gives nearly the same level of access as membership in
319`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100320permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700321
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200322
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800323=== Per-Project
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800324
Fredrik Luthanderda867882011-12-21 18:28:40 +0100325The per-project ACL is evaluated before the global `All-Projects` ACL,
326permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100327behavior is generally only useful on the `Read` category when
328granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800329
330
Fredrik Luthander98030252012-04-13 11:01:22 +0200331[[references]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800332== Special and magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200333
334The reference namespaces used in git are generally two, one for branches and
335one for tags:
336
337* +refs/heads/*+
338* +refs/tags/*+
339
340However, every reference under +refs/*+ is really available, and in Gerrit this
341opportunity for giving other refs a special meaning is used. In Gerrit they
342are sometimes used as magic/virtual references that give the push to Gerrit a
343special meaning.
344
345
346[[references_special]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800347=== Special references
Fredrik Luthander98030252012-04-13 11:01:22 +0200348
349The special references have content that's either generated by Gerrit or
350contains important project configuration that Gerrit needs. When making
351changes to these references, Gerrit will take extra precautions to verify the
352contents compatibility at upload time.
353
354
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800355==== refs/changes/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200356
357Under this namespace each uploaded patch set for every change gets a static
358reference in their git. The format is convenient but still intended to scale to
359hundreds of thousands of patch sets. To access a given patch set you will
360need the change number and patch set number.
361
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800362--
Fredrik Luthander98030252012-04-13 11:01:22 +0200363'refs/changes/'<last two digits of change number>/
364 <change number>/
365 <patch set number>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800366--
Fredrik Luthander98030252012-04-13 11:01:22 +0200367
368You can also find these static references linked on the page of each change.
369
370
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800371==== refs/meta/config
Fredrik Luthander98030252012-04-13 11:01:22 +0200372
Matt Baker3a40c6d2013-11-26 21:01:17 -0700373This is where the Gerrit configuration of each project resides. This
Fredrik Luthander98030252012-04-13 11:01:22 +0200374branch contains several files of importance: +project.config+, +groups+ and
Matt Baker3a40c6d2013-11-26 21:01:17 -0700375+rules.pl+. Together they control access and behavior during the change
Fredrik Luthander98030252012-04-13 11:01:22 +0200376review process.
377
378
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800379==== refs/meta/dashboards/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200380
381There's a dedicated page where you can read more about
382link:user-dashboards.html[User Dashboards].
383
384
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800385==== refs/notes/review
Fredrik Luthander98030252012-04-13 11:01:22 +0200386
387Autogenerated copy of review notes for all changes in the git. Each log entry
388on the refs/notes/review branch also references the patch set on which the
389review is made. This functionality is provided by the review-notes plugin.
390
391
392[[references_magic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800393=== Magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200394
395These are references with added functionality to them compared to a regular
396git push operation.
397
Edwin Kempin4bf01962014-04-16 16:47:10 +0200398[[refs_for]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800399==== refs/for/<branch ref>
Fredrik Luthander98030252012-04-13 11:01:22 +0200400
401Most prominent is the `refs/for/<branch ref>` reference which is the reference
402upon which we build the code review intercept before submitting a commit to
403the branch it's uploaded to.
404
405Further documentation on how to push can be found on the
406link:user-upload.html#push_create[Upload changes] page.
407
408
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800409==== refs/publish/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200410
Jonathan Nieder5758f182015-03-30 11:28:55 -0700411`+refs/publish/*+` is an alternative name to `+refs/for/*+` when pushing new changes
Fredrik Luthander98030252012-04-13 11:01:22 +0200412and patch sets.
413
414
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800415==== refs/drafts/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200416
Jonathan Nieder5758f182015-03-30 11:28:55 -0700417Push to `+refs/drafts/*+` creates a change like push to `+refs/for/*+`, except the
Fredrik Luthander98030252012-04-13 11:01:22 +0200418resulting change remains hidden from public review. You then have the option
419of adding individual reviewers before making the change public to all. The
420change page will have a 'Publish' button which allows you to convert individual
421draft patch sets of a change into public patch sets for review.
422
Jonathan Nieder5758f182015-03-30 11:28:55 -0700423To block push permission to `+refs/drafts/*+` the following permission rule can
David Ostrovsky07ddca52014-01-21 22:51:47 +0100424be configured:
425
426====
427 [access "refs/drafts/*"]
428 push = block group Anonymous Users
429====
430
Fredrik Luthander98030252012-04-13 11:01:22 +0200431
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200432[[access_categories]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800433== Access Categories
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800434
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200435Gerrit has several permission categories that can be granted to groups
436within projects, enabling functionality for that group's members.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800437
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200438
Fredrik Luthander69236de2013-05-09 14:50:39 +0200439
Chad Horohoe029c85a2012-06-07 16:10:14 -0400440[[category_abandon]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800441=== Abandon
Chad Horohoe029c85a2012-06-07 16:10:14 -0400442
443This category controls whether users are allowed to abandon changes
444to projects in Gerrit. It can give permission to abandon a specific
445change to a given ref.
446
David Pursehousec795eb12013-07-05 14:20:28 +0900447This also grants the permission to restore a change if the user also
448has link:#category_push[push permission] on the change's destination
449ref.
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400450
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200451
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100452[[category_create]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800453=== Create Reference
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100454
455The create reference category controls whether it is possible to
456create new references, branches or tags. This implies that the
457reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900458in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100459references (and also discard any commits in the process).
460
461It's probably most common to either permit the creation of a single
462branch in many gits (by granting permission on a parent project), or
463to grant this permission to a name pattern of branches.
464
465This permission is often given in conjunction with regular push
466branch permissions, allowing the holder of both to create new branches
467as well as bypass review for new commits on that branch.
468
David Pursehouse221d4f62012-06-08 17:38:08 +0900469To push lightweight (non-annotated) tags, grant
Jonathan Nieder5758f182015-03-30 11:28:55 -0700470`Create Reference` for reference name `+refs/tags/*+`, as lightweight
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100471tags are implemented just like branches in Git.
472
473For example, to grant the possibility to create new branches under the
474namespace `foo`, you have to grant this permission on
Jonathan Nieder5758f182015-03-30 11:28:55 -0700475`+refs/heads/foo/*+` for the group that should have it.
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100476Finally, if you plan to grant each user a personal namespace in
477where they are free to create as many branches as they wish, you
478should grant the create reference permission so it's possible
479to create new branches. This is done by using the special
480`${username}` keyword in the reference pattern, e.g.
Jonathan Nieder5758f182015-03-30 11:28:55 -0700481`+refs/heads/sandbox/${username}/*+`. If you do, it's also recommended
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100482you grant the users the push force permission to be able to clean up
483stale branches.
484
485
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100486[[category_forge_author]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800487=== Forge Author
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100488
489Normally Gerrit requires the author and the committer identity
490lines in a Git commit object (or tagger line in an annotated tag) to
491match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100492This permission allows users to bypass parts of that validation, which
493may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100494
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100495Permits the use of an unverified author line in commit objects.
496This can be useful when applying patches received by email from
4973rd parties, when cherry-picking changes written by others across
498branches, or when amending someone else's commit to fix up a minor
499problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100500
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100501By default this is granted to `Registered Users` in all projects,
502but a site administrator may disable it if verified authorship
503is required.
504
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100505
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100506[[category_forge_committer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800507=== Forge Committer
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100508
509Normally Gerrit requires the author and the committer identity
510lines in a Git commit object (or tagger line in an annotated tag) to
511match one of the registered email addresses of the uploading user.
512This permission allows users to bypass parts of that validation, which
513may be necessary when mirroring changes from an upstream project.
514
515Allows the use of an unverified committer line in commit objects, or an
516unverified tagger line in annotated tag objects. Typically this is only
517required when mirroring commits from an upstream project repository.
518
519
520[[category_forge_server]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800521=== Forge Server
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100522
523Normally Gerrit requires the author and the committer identity
524lines in a Git commit object (or tagger line in an annotated tag) to
525match one of the registered email addresses of the uploading user.
526This permission allows users to bypass parts of that validation, which
527may be necessary when mirroring changes from an upstream project.
528
529Allows the use of the server's own name and email on the committer
530line of a new commit object. This should only be necessary when force
531pushing a commit history which has been rewritten by 'git filter-branch'
532and that contains merge commits previously created by this Gerrit Code
533Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100534
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100535
536[[category_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800537=== Owner
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100538
539The `Owner` category controls which groups can modify the project's
540configuration. Users who are members of an owner group can:
541
542* Change the project description
Fredrik Luthander9c949382014-03-22 09:19:45 -0700543* Create a branch via the ssh command link:cmd-create-branch.html['create-branch']
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530544* Create/delete a branch through the web UI
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100545* Grant/revoke any access rights, including `Owner`
546
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530547To get SSH branch access project owners must grant an access right to a group
548they are a member of, just like for any other user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100549
550Ownership over a particular branch subspace may be delegated by
551entering a branch pattern. To delegate control over all branches
552that begin with `qa/` to the QA group, add `Owner` category
Jonathan Nieder5758f182015-03-30 11:28:55 -0700553for reference `+refs/heads/qa/*+`. Members of the QA group can
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100554further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100555`refs/heads/qa/`. See <<project_owners,project owners>> to find
556out more about this role.
557
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100558
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100559[[category_push]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800560=== Push
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100561
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100562This category controls how users are allowed to upload new commits
563to projects in Gerrit. It can either give permission to push
564directly into a branch, bypassing any code review process
565that would otherwise be used. Or it may give permission to upload
566new changes for code review, this depends on which namespace the
567permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100568
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100569
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100570[[category_push_direct]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800571==== Direct Push
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100572
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100573Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200574Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100575link:access-control.html#category_create['Create Reference']
576category. Deletion of existing branches is rejected. This is the
577safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100578
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100579* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100580+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100581Allows an existing branch to be deleted. Since a force push is
582effectively a delete immediately followed by a create, but performed
583atomically on the server and logged, this option also permits forced
584push updates to branches. Enabling this option allows existing commits
585to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100586
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100587The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100588take advantage of Gerrit's access control features and do not need
589its code review functionality. Projects that need to require code
590reviews should not grant this category.
591
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100592
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100593[[category_push_review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800594==== Upload To Code Review
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100595
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100596The `Push` access right granted on the namespace
597`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
598commit to the project's `refs/for/BRANCH` namespace, creating a new
599change for code review.
600
601A user must be able to clone or fetch the project in order to create
602a new commit on their local system, so in practice they must also
603have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100604
605For an open source, public Gerrit installation, it is common to
Jonathan Nieder5758f182015-03-30 11:28:55 -0700606grant `Read` and `Push` for `+refs/for/refs/heads/*+`
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100607to `Registered Users` in the `All-Projects` ACL. For more
608private installations, its common to simply grant `Read` and
Jonathan Nieder5758f182015-03-30 11:28:55 -0700609`Push` for `+refs/for/refs/heads/*+` to all users of a project.
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100610
611* Force option
612+
613The force option has no function when granted to a branch in the
Jonathan Nieder5758f182015-03-30 11:28:55 -0700614`+refs/for/refs/heads/*+` namespace.
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100615
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100616
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100617[[category_push_merge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800618=== Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100619
Magnus Bäck282c1022012-04-18 15:39:17 -0400620The `Push Merge Commit` access right permits the user to upload merge
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100621commits. It's an add-on to the <<category_push,Push>> access right, and
Magnus Bäck282c1022012-04-18 15:39:17 -0400622so it won't be sufficient with only `Push Merge Commit` granted for a
623push to happen. Some projects wish to restrict merges to being created
624by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100625merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100626
Jonathan Niederdaf8bd42013-10-01 15:06:14 -0700627The reference name connected to a `Push Merge Commit` entry must always
628be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
629This applies even for an entry that complements a `Push` entry for
630`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
631the intention of the `Push Merge Commit` entry is to allow direct pushes
632of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100633
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200634
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100635[[category_push_annotated]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800636=== Push Annotated Tag
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100637
David Pursehouse690cebe2012-12-12 19:22:45 +0900638This category permits users to push an annotated tag object into the
639project's repository. Typically this would be done with a command line
640such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100641
642====
643 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
644====
645
David Pursehouse690cebe2012-12-12 19:22:45 +0900646Or:
647
648====
649 git push https://HOST/PROJECT tag v1.0
650====
651
David Pursehouseb429ce12012-12-12 11:04:40 +0900652Tags must be annotated (created with `git tag -a`), should exist in
653the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100654
655This category is intended to be used to publish tags when a project
656reaches a stable release point worth remembering in history.
657
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100658It allows for a new annotated (unsigned) tag to be created. The
659tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100660
661To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100662as tags mirrored from an upstream project), `Forge Committer Identity`
663must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100664
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100665To push lightweight (non annotated) tags, grant
666<<category_create,`Create Reference`>> for reference name
Jonathan Nieder5758f182015-03-30 11:28:55 -0700667`+refs/tags/*+`, as lightweight tags are implemented just like
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100668branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100669
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100670To delete or overwrite an existing tag, grant `Push` with the force
Jonathan Nieder5758f182015-03-30 11:28:55 -0700671option enabled for reference name `+refs/tags/*+`, as deleting a tag
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100672requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100673
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100674
David Pursehouseb429ce12012-12-12 11:04:40 +0900675[[category_push_signed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800676=== Push Signed Tag
David Pursehouseb429ce12012-12-12 11:04:40 +0900677
David Pursehouse690cebe2012-12-12 19:22:45 +0900678This category permits users to push a PGP signed tag object into the
679project's repository. Typically this would be done with a command
680line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900681
682====
683 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
684====
685
David Pursehouse690cebe2012-12-12 19:22:45 +0900686Or:
687
688====
689 git push https://HOST/PROJECT tag v1.0
690====
691
David Pursehouseb429ce12012-12-12 11:04:40 +0900692Tags must be signed (created with `git tag -s`), should exist in the
693`refs/tags/` namespace, and should be new.
694
695
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100696[[category_read]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800697=== Read
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100698
699The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100700changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100701A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100702changes, or any of its data.
703
704This category has a special behavior, where the per-project ACL is
705evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100706ACL has granted `Read` with 'DENY', and does not otherwise grant
707`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100708is ignored. This behavior is useful to hide a handful of projects
709on an otherwise public server.
710
711For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100712`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
713casual browsing of any project's changes, as well as fetching any
714project's repository over SSH or HTTP. New projects can be
715temporarily hidden from public view by granting `Read` with 'DENY'
716to `Anonymous Users` and granting `Read` to the project owner's
717group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100718
719For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100720source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100721typical, enabling read access only to those users who have been
722able to authenticate through the HTTP access controls. This may
723be suitable in a corporate deployment if the HTTP access control
724is already restricted to the correct set of users.
725
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100726
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200727[[category_rebase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800728=== Rebase
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200729
730This category permits users to rebase changes via the web UI by pushing
731the `Rebase Change` button.
732
733The change owner and submitters can always rebase changes in the web UI
734(even without having the `Rebase` access right assigned).
735
736Users without this access right who are able to upload new patch sets
737can still do the rebase locally and upload the rebased commit as a new
738patch set.
739
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200740
Chad Horohoec626f3c2012-09-13 11:04:20 -0700741[[category_remove_reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800742=== Remove Reviewer
Chad Horohoec626f3c2012-09-13 11:04:20 -0700743
744This category permits users to remove other users from the list of
745reviewers on a change.
746
David Pursehouseb3d13832014-12-04 14:50:37 +0900747Change owners can always remove reviewers who have given a zero or positive
748score (even without having the `Remove Reviewer` access right assigned).
749
750Project owners and site administrators can always remove any reviewer (even
751without having the `Remove Reviewer` access right assigned).
Chad Horohoec626f3c2012-09-13 11:04:20 -0700752
753Users without this access right can only remove themselves from the
754reviewer list on a change.
755
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200756
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200757[[category_review_labels]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800758=== Review Labels
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200759
760For every configured label `My-Name` in the project, there is a
761corresponding permission `label-My-Name` with a range corresponding to
Shawn Pearce9d783122013-06-11 18:18:03 -0700762the defined values. There is also a corresponding `labelAs-My-Name`
763permission that enables editing another user's label.
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200764
765Gerrit comes pre-configured with a default 'Code-Review' label that can
766be granted to groups within projects, enabling functionality for that
767group's members. link:config-labels.html[Custom labels] may also be
768defined globally or on a per-project basis.
769
770
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100771[[category_submit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800772=== Submit
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800773
David Pursehouse6bf46ed2015-02-04 20:31:23 +0900774This category permits users to submit changes.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800775
776Submitting a change causes it to be merged into the destination
777branch as soon as possible, making it a permanent part of the
David Pursehouse22bd6f92014-02-20 21:11:01 +0900778project's history.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800779
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800780In order to submit, all labels (such as `Verified` and `Code-Review`,
781above) must enable submit, and also must not block it. See above for
782details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800783
Edwin Kempinbfa06212013-04-04 16:06:39 +0200784To link:user-upload.html#auto_merge[immediately submit a change on push]
785the caller needs to have the Submit permission on `refs/for/<ref>`
786(e.g. on `refs/for/refs/heads/master`).
787
David Pursehouse22bd6f92014-02-20 21:11:01 +0900788[[category_submit_on_behalf_of]]
789=== Submit (On Behalf Of)
790
791This category permits users who have also been granted the `Submit`
Dave Borowitzc6d143d2016-02-24 12:32:23 -0500792permission to submit changes on behalf of another user, by using the
793`on_behalf_of` field in link:rest-api-changes.html#submit-input[SubmitInput]
794when link:rest-api-changes.html#submit-change[submitting using the REST API].
David Pursehouse22bd6f92014-02-20 21:11:01 +0900795
796Note that this permission is named `submitAs` in the `project.config`
797file.
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100798
David Pursehouse5ae73002012-11-01 15:22:26 +0900799[[category_view_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800800=== View Drafts
David Pursehouse5ae73002012-11-01 15:22:26 +0900801
802This category permits users to view draft changes uploaded by other
803users.
804
805The change owner and any explicitly added reviewers can always see
806draft changes (even without having the `View Drafts` access right
807assigned).
808
809
David Pursehousebe7f4582012-12-12 11:21:29 +0900810[[category_publish_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800811=== Publish Drafts
David Pursehousebe7f4582012-12-12 11:21:29 +0900812
813This category permits users to publish draft changes uploaded by other
814users.
815
816The change owner can always publish draft changes (even without having
817the `Publish Drafts` access right assigned).
818
819
820[[category_delete_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800821=== Delete Drafts
David Pursehousebe7f4582012-12-12 11:21:29 +0900822
823This category permits users to delete draft changes uploaded by other
824users.
825
826The change owner can always delete draft changes (even without having
827the `Delete Drafts` access right assigned).
828
829
David Pursehouse59aee362012-11-15 17:25:17 +0900830[[category_edit_topic_name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800831=== Edit Topic Name
David Pursehouse59aee362012-11-15 17:25:17 +0900832
833This category permits users to edit the topic name of a change that
834is uploaded for review.
835
836The change owner, branch owners, project owners, and site administrators
837can always edit the topic name (even without having the `Edit Topic Name`
838access right assigned).
839
Edwin Kempin1f77b532013-11-08 07:16:31 +0100840Whether the topic can be edited on closed changes can be controlled
841by the 'Force Edit' flag. If this flag is not set the topic can only be
842edited on open changes.
843
David Pursehouse59aee362012-11-15 17:25:17 +0900844
David Pursehousede711702014-09-10 16:23:34 +0200845[[category_edit_hashtags]]
846=== Edit Hashtags
847
848This category permits users to add or remove hashtags on a change that
849is uploaded for review.
850
851The change owner, branch owners, project owners, and site administrators
852can always edit or remove hashtags (even without having the `Edit Hashtags`
853access right assigned).
854
855
Edwin Kempin4bf01962014-04-16 16:47:10 +0200856[[example_roles]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800857== Examples of typical roles in a project
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100858
859Below follows a set of typical roles on a server and which access
860rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900861general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100862brand new Gerrit instance.
863
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200864
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100865[[examples_contributor]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800866=== Contributor
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100867
868This is the typical user on a public server. They are able to read
869your project and upload new changes to it. They are able to give
870feedback on other changes as well, but are unable to block or approve
871any changes.
872
873Suggested access rights to grant:
874
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800875* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
876* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
877* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100878
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100879If it's desired to have the possibility to upload temporarily hidden
880changes there's a specific permission for that. This enables someone
881to add specific reviewers for early feedback before making the change
David Pursehouse1ff91c02015-05-19 15:05:26 +0900882publicly visible. If you want to allow others than the owners to
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100883publish a draft you also need to grant them `Publish Drafts`.
884
885Optional access rights to grant:
886
887* xref:category_push[`Push`] to 'refs/drafts/*'
888* xref:category_publish_drafts[`Publish Drafts`] to 'refs/heads/*'
889
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100890
Fredrik Luthander654161c2012-01-31 14:42:36 +0100891[[examples_developer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800892=== Developer
Fredrik Luthander654161c2012-01-31 14:42:36 +0100893
894This is the typical core developer on a public server. They are able
895to read the project, upload changes to a branch. They are allowed to
896push merge commits to merge branches together. Also, they are allowed
897to forge author identity, thus handling commits belonging to others
898than themselves, effectively allowing them to transfer commits
899between different branches.
900
901They are furthermore able to code review and verify commits, and
902eventually submit them. If you have an automated CI system that
903builds all uploaded patch sets you might want to skip the
904verification rights for the developer and let the CI system do that
905exclusively.
906
907Suggested access rights to grant:
908
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800909* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
910* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
911* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
912* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
913* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-2' to '+2' for 'refs/heads/*'
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200914* link:config-labels.html#label_Verified[`Label: Verified`] with range '-1' to '+1' for 'refs/heads/*'
Edwin Kempin7b1897c2015-04-16 15:13:44 +0200915* xref:category_submit[`Submit`] on 'refs/heads/*'
Fredrik Luthander654161c2012-01-31 14:42:36 +0100916
917If the project is small or the developers are seasoned it might make
918sense to give them the freedom to push commits directly to a branch.
919
920Optional access rights to grant:
921
922* <<category_push,`Push`>> to 'refs/heads/*'
923* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
924
925
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100926[[examples_cisystem]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800927=== CI system
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100928
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100929A typical Continuous Integration system should be able to download new changes
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100930to build and then leave a verdict somehow.
931
932As an example, the popular
933link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
934for Jenkins/Hudson can set labels at:
935
936* The start of a build
937* A successful build
938* An unstable build (tests fails)
939* A failed build
940
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200941Usually the range chosen for this verdict is the `Verified` label. Depending on
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100942the size of your project and discipline of involved developers you might want
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200943to limit access right to the +1 `Verified` label to the CI system only. That
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100944way it's guaranteed that submitted commits always get built and pass tests
945successfully.
946
947If the build doesn't complete successfully the CI system can set the
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200948`Verified` label to -1. However that means that a failed build will block
949submit of the change even if someone else sets `Verified` +1. Depending on the
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100950project and how much the CI system can be trusted for accurate results, a
951blocking label might not be feasible. A recommended alternative is to set the
952label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900953shows a red label in the Gerrit UI. Optionally, to enable the possibility to
954deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100955possible to set `Code-review` +1 as well.
956
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200957If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100958submitted changes for upload to other branches under certain conditions. This
959is probably not the first step of what a project wants to automate however,
960and so the push right can be found under the optional section.
961
962Suggested access rights to grant, that won't block changes:
963
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800964* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
965* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '0' for 'refs/heads/*'
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200966* link:config-labels.html#label_Verified[`Label: Verified`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100967
968Optional access rights to grant:
969
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800970* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
971* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100972
973
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100974[[examples_integrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800975=== Integrator
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100976
977Integrators are like developers but with some additional rights granted due
978to their administrative role in a project. They can upload or push any commit
979with any committer email (not just their own) and they can also create new
980tags and branches.
981
982Suggested access rights to grant:
983
984* <<examples_developer,Developer rights>>
985* <<category_push,`Push`>> to 'refs/heads/*'
986* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200987* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100988* <<category_create,`Create Reference`>> to 'refs/heads/*'
989* <<category_push_annotated,`Push Annotated Tag`>> to 'refs/tags/*'
990
991
Fredrik Luthander9c645362012-03-22 18:10:42 +0100992[[examples_project-owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800993=== Project owner
Fredrik Luthander9c645362012-03-22 18:10:42 +0100994
995The project owner is almost like an integrator but with additional destructive
996power in the form of being able to delete branches. Optionally these users
997also have the power to configure access rights in gits assigned to them.
998
999[WARNING]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001000These users should be really knowledgeable about git, for instance knowing why
Fredrik Luthander9c645362012-03-22 18:10:42 +01001001tags never should be removed from a server. This role is granted potentially
1002destructive access rights and cleaning up after such a mishap could be time
1003consuming!
1004
1005Suggested access rights to grant:
1006
1007* <<examples_integrator,Integrator rights>>
1008* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
1009
1010Optional access right to grant:
1011
1012* <<category_owner,`Owner`>> in the gits they mostly work with.
1013
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001014
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001015[[examples_administrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001016=== Administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001017
1018The administrator role is the most powerful role known in the Gerrit universe.
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +01001019This role may grant itself (or others) any access right. By default the
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001020<<administrators,`Administrators` group>> is the group that has this role.
1021
1022Mandatory access rights:
1023
1024* <<capability_administrateServer,The `Administrate Server` capability>>
1025
1026Suggested access rights to grant:
1027
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +01001028* <<examples_project-owner,`Project owner rights`>>
1029* Any <<global_capabilities,`capabilities`>> needed by the administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001030
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001031
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001032== Enforcing site wide access policies
Sasa Zivkovd589f462013-02-12 14:27:09 +01001033
Jonathan Nieder5758f182015-03-30 11:28:55 -07001034By granting the <<category_owner,`Owner`>> access right on the `+refs/*+` to a
Sasa Zivkovd589f462013-02-12 14:27:09 +01001035group, Gerrit administrators can delegate the responsibility of maintaining
1036access rights for that project to that group.
1037
1038In a corporate deployment it is often necessary to enforce some access
1039policies. An example could be that no-one can update or delete a tag, not even
1040the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
1041purpose as project owners can grant themselves any access right they wish and,
1042thus, effectively override any inherited access rights from the
1043"`All-Projects`" or some other common parent project.
1044
1045What is needed is a mechanism to block a permission in a parent project so
1046that even project owners cannot allow a blocked permission in their child
1047project. Still, project owners should retain the possibility to manage all
1048non-blocked rules as they wish. This gives best of both worlds:
1049
1050* Gerrit administrators can concentrate on enforcing site wide policies
1051 and providing a meaningful set of default access permissions
1052* Project owners can manage access rights of their projects without a danger
1053 of violating a site wide policy
1054
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001055
Edwin Kempin60ab8532013-03-27 14:33:46 +01001056[[block]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001057=== 'BLOCK' access rule
Sasa Zivkovd589f462013-02-12 14:27:09 +01001058
1059The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK' rule cannot
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001060be overridden in the inheriting project. Any 'ALLOW' rule, from a different
1061access section or from an inheriting project, which conflicts with an
1062inherited 'BLOCK' rule will not be honored. Searching for 'BLOCK' rules, in
Sasa Zivkovd589f462013-02-12 14:27:09 +01001063the chain of parent projects, ignores the Exclusive flag that is normally
1064applied to access sections.
1065
1066A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1067force or not. A blocking force push rule blocks only force pushes, but
1068allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1069
1070It is also possible to block label ranges. To block a group 'X' from voting
1071'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1072range intact we would define:
1073
1074====
1075 [access "refs/heads/*"]
1076 label-Code-Review = block -2..+2 group X
1077====
1078
1079The interpretation of the 'min..max' range in case of a blocking rule is: block
1080every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1081means that the range '-1..+1' is not affected by this block.
1082
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001083=== 'BLOCK' and 'ALLOW' rules in the same access section
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001084
1085When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1086the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1087
1088====
1089 [access "refs/heads/*"]
1090 push = block group X
1091 push = group Y
1092====
1093
1094In this case a user which is a member of the group 'Y' will still be allowed to
1095push to 'refs/heads/*' even if it is a member of the group 'X'.
1096
1097NOTE: An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
1098inside the same access section of the same project. An 'ALLOW' rule in a
1099different access section of the same project or in any access section in an
1100inheriting project cannot override a 'BLOCK' rule.
1101
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001102
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001103=== Examples
Sasa Zivkovd589f462013-02-12 14:27:09 +01001104
1105The following examples show some possible use cases for the 'BLOCK' rules.
1106
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001107==== Make sure no one can update or delete a tag
Sasa Zivkovd589f462013-02-12 14:27:09 +01001108
1109This requirement is quite common in a corporate deployment where
1110reproducibility of a build must be guaranteed. To achieve that we block 'push'
1111permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1112
1113====
1114 [access "refs/tags/*"]
1115 push = block group Anonymous Users
1116====
1117
1118By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1119everyone as everyone is a member of that group. Note that the permission to
1120create a tag is still necessary. Assuming that only <<category_owner,project
1121owners>> are allowed to create tags, we would extend the example above:
1122
1123====
1124 [access "refs/tags/*"]
1125 push = block group Anonymous Users
1126 create = group Project Owners
1127 pushTag = group Project Owners
1128====
Fredrik Luthander9c645362012-03-22 18:10:42 +01001129
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001130
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001131==== Let only a dedicated group vote in a special category
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001132
1133Assume there is a more restrictive process for submitting changes in stable
1134release branches which is manifested as a new voting category
1135'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1136group can vote in this category and that even project owners cannot approve
1137this category. We have to block everyone except the 'Release Engineers' to vote
1138in this category and, of course, allow 'Release Engineers' to vote in that
1139category. In the "`All-Projects`" we define the following rules:
1140
1141====
1142 [access "refs/heads/stable*"]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001143 label-Release-Process = block -1..+1 group Anonymous Users
1144 label-Release-Process = -1..+1 group Release Engineers
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001145====
1146
David Pursehouse8becc2a2013-04-23 18:51:04 +09001147[[global_capabilities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001148== Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001149
David Pursehouse8becc2a2013-04-23 18:51:04 +09001150The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001151the server can perform which usually affect the entire
1152server in some way. The administrators may delegate these
1153capabilities to trusted groups of users.
1154
1155Delegation of capabilities allows groups to be granted a subset of
1156administrative capabilities without being given complete
1157administrative control of the server. This makes it possible to
1158keep fewer users in the administrators group, even while spreading
1159much of the server administration burden out to more users.
1160
David Pursehouse8becc2a2013-04-23 18:51:04 +09001161Global capabilities are assigned to groups in the access rights settings
1162of the root project ("`All-Projects`").
1163
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001164Below you find a list of capabilities available:
1165
1166
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001167[[capability_accessDatabase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001168=== Access Database
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001169
Dave Borowitzd9b8b392014-09-11 13:49:54 +02001170Allow users to access the database using the `gsql` command, and view code
1171review metadata refs in repositories.
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001172
1173
Fredrik Luthander426885f2012-02-13 09:56:57 +01001174[[capability_administrateServer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001175=== Administrate Server
Fredrik Luthander426885f2012-02-13 09:56:57 +01001176
1177This is in effect the owner and administrator role of the Gerrit
1178instance. Any members of a group granted this capability will be
1179able to grant any access right to any group. They will also have all
1180capabilities granted to them automatically.
1181
1182
Bruce Zu4512fe62014-11-18 17:39:41 +08001183[[capability_batchChangesLimit]]
1184=== Batch Changes Limit
1185
1186Allow site administrators to configure the batch changes limit for
1187users to override the system config
1188link:config-gerrit.html#receive.maxBatchChanges['receive.maxBatchChanges'].
1189
1190Administrators can add a global block to `All-Projects` with group(s)
1191that should have different limits.
1192
1193When applying a batch changes limit to a user the largest value
1194granted by any of their groups is used. 0 means no limit.
1195
1196
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001197[[capability_createAccount]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001198=== Create Account
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001199
Fredrik Luthander79d38152012-03-13 09:52:22 +01001200Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001201This capability allows the granted group members to create non-interactive
1202service accounts. These service accounts are generally used for automation
1203and made to be members of the
1204link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1205
1206
Fredrik Luthander79d38152012-03-13 09:52:22 +01001207[[capability_createGroup]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001208=== Create Group
Fredrik Luthander79d38152012-03-13 09:52:22 +01001209
1210Allow group creation. Groups are used to grant users access to different
1211actions in projects. This capability allows the granted group members to
1212either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1213
1214
1215[[capability_createProject]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001216=== Create Project
Fredrik Luthander79d38152012-03-13 09:52:22 +01001217
1218Allow project creation. This capability allows the granted group to
1219either link:cmd-create-project.html[create new git projects via ssh]
1220or via the web UI.
1221
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001222
Sasa Zivkov812f4892012-06-21 16:25:21 +02001223[[capability_emailReviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001224=== Email Reviewers
Sasa Zivkov812f4892012-06-21 16:25:21 +02001225
1226Allow or deny sending email to change reviewers and watchers. This can be used
1227to deny build bots from emailing reviewers and people who watch the change.
1228Instead, only the authors of the change and those who starred it will be
1229emailed. The allow rules are evaluated before deny rules, however the default
1230is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001231
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001232
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001233[[capability_flushCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001234=== Flush Caches
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001235
Fredrik Luthander48603002012-03-21 18:17:17 +01001236Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001237group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1238
1239[NOTE]
1240This capability doesn't imply permissions to the show-caches command. For that
1241you need the <<capability_viewCaches,view caches capability>>.
1242
1243
Fredrik Luthander46843022012-03-13 16:11:02 +01001244[[capability_kill]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001245=== Kill Task
Fredrik Luthander46843022012-03-13 16:11:02 +01001246
1247Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1248kill command ends tasks that currently occupy the Gerrit server, usually
1249a replication task or a user initiated task such as an upload-pack or
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001250receive-pack.
Fredrik Luthander46843022012-03-13 16:11:02 +01001251
Dave Borowitz664d0402015-06-11 15:35:48 -04001252[[capability_maintainServer]]
1253=== Maintain Server
1254
1255Allow basic, constrained server maintenance tasks, such as flushing caches and
1256reindexing changes. Does not grant arbitrary database access, read/write, or
1257ACL management permissions, as might the
1258<<capability_administrateServer,administrate server capability>>.
1259
1260Implies the following capabilities:
1261
1262* <<capability_flushCaches,Flush Caches>>
1263* <<capability_kill,Kill Task>>
1264* <<capability_runGC,Run Garbage Collection>>
1265* <<capability_viewCaches,View Caches>>
1266* <<capability_viewQueue,View Queue>>
1267
David Ostrovskyaa49e272014-07-22 00:55:47 +02001268[[capability_modifyAccount]]
1269=== Modify Account
1270
1271Allow to link:cmd-set-account.html[modify accounts over the ssh prompt].
1272This capability allows the granted group members to modify any user account
1273setting.
Fredrik Luthander46843022012-03-13 16:11:02 +01001274
1275[[capability_priority]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001276=== Priority
Fredrik Luthander46843022012-03-13 16:11:02 +01001277
1278This capability allows users to use
1279link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1280link:access-control.html#non-interactive_users['Non-Interactive Users'].
1281It's a binary value in that granted users either have access to the thread
1282pool, or they don't.
1283
1284There are three modes for this capability and they're listed by rising
1285priority:
1286
1287No capability configured.::
1288The user isn't a member of a group with any priority capability granted. By
1289default the user is then in the 'INTERACTIVE' thread pool.
1290
1291'BATCH'::
1292If there's a thread pool configured for 'Non-Interactive Users' and a user is
1293granted the priority capability with the 'BATCH' mode selected, the user ends
1294up in the separate batch user thread pool. This is true unless the user is
1295also granted the below 'INTERACTIVE' option.
1296
1297'INTERACTIVE'::
1298If a user is granted the priority capability with the 'INTERACTIVE' option,
1299regardless if they also have the 'BATCH' option or not, they are in the
1300'INTERACTIVE' thread pool.
1301
1302
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001303[[capability_queryLimit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001304=== Query Limit
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001305
1306Allow site administrators to configure the query limit for users to
1307be above the default hard-coded value of 500. Administrators can add
David Pursehouseb5d99aaf2013-08-09 11:02:48 +09001308a global block to `All-Projects` with group(s) that should have different
1309limits.
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001310
1311When applying a query limit to a user the largest value granted by
1312any of their groups is used.
1313
1314This limit applies not only to the link:cmd-query.html[`gerrit query`]
1315command, but also to the web UI results pagination size.
1316
1317
Shawn Pearcebb027b02013-06-10 14:35:39 -07001318[[capability_runAs]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001319=== Run As
Shawn Pearcebb027b02013-06-10 14:35:39 -07001320
Shawn Pearcef3ffd082013-06-12 11:21:35 -07001321Allow users to impersonate any other user with the `X-Gerrit-RunAs`
1322HTTP header on REST API calls, or the link:cmd-suexec.html[suexec]
1323SSH command.
1324
1325When impersonating an administrator the Administrate Server capability
1326is not honored. This security feature tries to prevent a role with
1327Run As capability from modifying the access controls in All-Projects,
1328however modification may still be possible if the impersonated user
1329has permission to push or submit changes on `refs/meta/config`. Run
1330As also blocks using most capabilities including Create User, Run
1331Garbage Collection, etc., unless the capability is also explicitly
1332granted to a group the administrator is a member of.
1333
1334Administrators do not automatically inherit this capability; it must
1335be explicitly granted.
Shawn Pearcebb027b02013-06-10 14:35:39 -07001336
1337
Edwin Kempin619169b2012-02-09 15:47:52 +01001338[[capability_runGC]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001339=== Run Garbage Collection
Edwin Kempin619169b2012-02-09 15:47:52 +01001340
1341Allow users to run the Git garbage collection for the repositories of
1342all projects.
1343
1344
Ed Bartoshd168b812013-04-13 20:15:58 +03001345[[capability_streamEvents]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001346=== Stream Events
Ed Bartoshd168b812013-04-13 20:15:58 +03001347
1348Allow performing streaming of Gerrit events. This capability
1349allows the granted group to
1350link:cmd-stream-events.html[stream Gerrit events via ssh].
1351
1352
Dave Borowitzf3548a92014-02-20 11:02:19 -08001353[[capability_viewAllAccounts]]
1354=== View All Accounts
1355
1356Allow viewing all accounts for purposes of auto-completion, regardless
1357of link:config-gerrit.html#accounts.visibility[accounts.visibility]
1358setting.
1359
1360
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001361[[capability_viewCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001362=== View Caches
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001363
Fredrik Luthander48603002012-03-21 18:17:17 +01001364Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001365the granted group to
1366link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1367
1368
Fredrik Luthander48603002012-03-21 18:17:17 +01001369[[capability_viewConnections]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001370=== View Connections
Fredrik Luthander48603002012-03-21 18:17:17 +01001371
1372Allow querying for status of Gerrit's current client connections. This
1373capability allows the granted group to
1374link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1375
1376
Edwin Kempin362b14d12014-05-09 14:18:12 +02001377[[capability_viewPlugins]]
1378=== View Plugins
1379
1380Allow viewing the list of installed plugins.
1381
1382
Fredrik Luthander48603002012-03-21 18:17:17 +01001383[[capability_viewQueue]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001384=== View Queue
Fredrik Luthander48603002012-03-21 18:17:17 +01001385
1386Allow querying for status of Gerrit's internal task queue. This capability
1387allows the granted group to
1388link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1389
1390
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001391GERRIT
1392------
1393Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07001394
1395SEARCHBOX
1396---------