blob: 4add381b1656465533c3a6d137d43bff3b6236be [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= Gerrit Code Review - Access Controls
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08003
4Access controls in Gerrit are group based. Every user account is a
5member of one or more groups, and access and privileges are granted
Matt Fischer620255a2011-03-22 14:28:23 -05006to those groups. Access rights cannot be granted to individual
7users.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08008
Jeff Gastonca20ec62018-10-16 12:42:35 -04009To view/edit the access controls for a specific project, first
10navigate to the projects page: for example,
Marian Harbach34253372019-12-10 18:01:31 +010011https://gerrit-review.googlesource.com/admin/repos/[role=external,window=_blank]. Then click on
Jeff Gastonca20ec62018-10-16 12:42:35 -040012the individual project, and then click Access. This will bring you
13to a url that looks like
Marian Harbach34253372019-12-10 18:01:31 +010014https://gerrit-review.googlesource.com/admin/repos/gerrit,access[role=external,window=_blank]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080015
Edwin Kempin4bf01962014-04-16 16:47:10 +020016[[system_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080017== System Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080018
Anita Kuno178f64b2014-04-22 18:52:28 -040019Gerrit comes with the following system groups:
Khai Do4245e6f2013-10-11 18:14:31 +020020
Khai Do4245e6f2013-10-11 18:14:31 +020021* Anonymous Users
22* Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020023* Project Owners
24* Registered Users
25
26The system groups are assigned special access and membership management
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -070027privileges.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080028
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020029
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010030[[anonymous_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080031=== Anonymous Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080032
33All users are automatically a member of this group. Users who are
34not signed in are a member of only this group, and no others.
35
36Any access rights assigned to this group are inherited by all users.
37
38Administrators and project owners can grant access rights to this
39group in order to permit anonymous users to view project changes,
40without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010041to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080042identity for all other operations.
43
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020044
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010045[[project_owners]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080046=== Project Owners
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010047
48Access rights assigned to this group are always evaluated within the
49context of a project to which the access rights apply. These rights
50therefore apply to all the users who are owners of this project.
51
52By assigning access rights to this group on a parent project Gerrit
53administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010054<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010055access rights where they are resolved to the users that own the child
56project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010057<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010058avoid the need to initially configure access rights for
59newly created child projects.
60
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020061
Khai Do4245e6f2013-10-11 18:14:31 +020062[[change_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080063=== Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020064
65Access rights assigned to this group are always evaluated within the
66context of a change to which the access rights apply. These rights
67therefore apply to the user who is the owner of this change.
68
69It is typical to assign a label to this group, allowing the change
70owner to vote on his change, but not actually cause it to become
71approved or rejected.
72
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010073[[registered_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080074=== Registered Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080075
76All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +010077also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080078
79Any access rights assigned to this group are inherited by all
80users as soon as they sign-in to Gerrit. If OpenID authentication
81is being employed, moving from only 'Anonymous Users' into this
82group is very easy. Caution should be taken when assigning any
83permissions to this group.
84
Dave Borowitz01c1b1f2013-02-27 13:49:04 -080085It is typical to assign `Code-Review -1..+1` to this group,
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080086allowing signed-in users to vote on a change, but not actually
87cause it to become approved or rejected.
88
89Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010090on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080091
92
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -070093== Predefined Groups
94
95Predefined groups differs from system groups by the fact that they
96exist in the ACCOUNT_GROUPS table (like normal groups) but predefined groups
97are created on Gerrit site initialization and unique UUIDs are assigned
98to those groups. These UUIDs are different on different Gerrit sites.
99
100Gerrit comes with two predefined groups:
101
102* Administrators
Patrick Hiesele587c402020-08-07 16:11:29 +0200103* Service Users
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700104
105
106[[administrators]]
107=== Administrators
108
Edwin Kempin17287422016-04-07 08:44:39 +0200109This is a predefined group, created on Gerrit site initialization, that
110has the capability link:access-control.html#capability_administrateServer[
111'Administrate Server'] assigned.
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700112
Edwin Kempin17287422016-04-07 08:44:39 +0200113It is a normal Gerrit group without magic. This means if you remove
114the 'Administrate Server' capability from it, its members are no longer
115Gerrit administrators, despite the group name. The group may also be
116renamed.
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700117
118
119[[non-interactive_users]]
Patrick Hiesele587c402020-08-07 16:11:29 +0200120=== Service Users
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700121
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
Patrick Hiesele587c402020-08-07 16:11:29 +0200134made by the service users from the ones made by the interactive
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700135users. 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
Gal Paikine871aaa2020-06-26 14:05:53 +0300189When projects are set as parent projects, the child projects inherit
190all of the parent's access rights. "`All-Projects`" is treated as a
191parent of all projects.
192
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800193Per-project access control lists are also supported.
194
195Users are permitted to use the maximum range granted to any of their
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800196groups on a label. For example, a user is a member of `Foo Leads`, and
197the following ACLs are granted on a project:
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800198
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100199[options="header"]
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800200|===================================================
201|Group |Reference Name |Label |Range
202|Anonymous Users |refs/heads/* |Code-Review|-1..+1
203|Registered Users|refs/heads/* |Code-Review|-1..+2
204|Foo Leads |refs/heads/* |Code-Review|-2..0
205|===================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800206
207Then the effective range permitted to be used by the user is
208`-2..+2`, as the user is a member of all three groups (see above
209about the system groups) and the maximum range is chosen (so the
210lowest value granted to any group, and the highest value granted
211to any group).
212
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800213Reference-level access control is also possible.
214
215Permissions can be set on a single reference name to match one
216branch (e.g. `refs/heads/master`), or on a reference namespace
Jonathan Nieder5758f182015-03-30 11:28:55 -0700217(e.g. `+refs/heads/*+`) to match any branch starting with that
Sebastian Schuberth7bcfbaf2016-05-23 14:06:03 +0200218prefix. So a permission with `+refs/heads/*+` will match all of
219`refs/heads/master`, `refs/heads/experimental`, `refs/heads/release/1.0` etc.
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800220
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700221Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200222by prefixing the reference name with `^`. For example
223`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700224between 1 and 8 characters long. Within a regular expression `.`
225is a wildcard matching any character, but may be escaped as `\.`.
Marian Harbach34253372019-12-10 18:01:31 +0100226The link:http://www.brics.dk/automaton/[dk.brics.automaton library,role=external,window=_blank]
Magnus Bäcke5611832011-02-02 08:57:15 +0100227is used for evaluation of regular expression access control
228rules. See the library documentation for details on this
Doug Claare852eb32016-03-18 14:43:28 -0700229particular regular expression flavor. One quirk is that the
230shortest possible pattern expansion must be a valid ref name:
231thus `^refs/heads/.*/name` will fail because `refs/heads//name`
232is not a valid reference, but `^refs/heads/.+/name` will work.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700233
Edwin Kempin311d5702017-07-28 15:10:24 +0200234[[sharded-user-id]]
Edwin Kempinad6f15b2016-05-04 18:20:05 +0200235References can have the user name or the sharded account ID of the
236current user automatically included, creating dynamic access controls
237that change to match the currently logged in user. For example to
238provide a personal sandbox space to all developers,
239`+refs/heads/sandbox/${username}/*+` allows the user 'joe' to use
240'refs/heads/sandbox/joe/foo'. The sharded account ID can be used to
241give users access to their user branch in the `All-Users` repository,
242for example `+refs/users/${shardeduserid}+` is resolved to
243'refs/users/23/1011123' if the account ID of the current user is
244`1011123`.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700245
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800246When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700247the full set of access rights to determine if the user
248is allowed to perform a given action. For example, if a user is a
249member of `Foo Leads`, they are reviewing a change destined for
250the `refs/heads/qa` branch, and the following ACLs are granted
251on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800252
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100253[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100254|===============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800255|Group |Reference Name|Label |Range |Exclusive
256|Registered Users |refs/heads/* |Code-Review| -1..+1 |
257|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
258|QA Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100259|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800260
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700261Then the effective range permitted to be used by the user is
262`-2..+2`, as the user's membership of `Foo Leads` effectively grant
263them access to the entire reference space, thanks to the wildcard.
264
265Gerrit also supports exclusive reference-level access control.
266
267It is possible to configure Gerrit to grant an exclusive ref level
268access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100269an operation on a project/reference pair. This is done by ticking
270the exclusive flag when setting the permission for the
271`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700272
273For example, if a user who is a member of `Foo Leads` tries to
274review a change destined for branch `refs/heads/qa` in a project,
275and the following ACLs are granted:
276
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100277[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100278|==============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800279|Group |Reference Name|Label |Range |Exclusive
280|Registered Users|refs/heads/* |Code-Review| -1..+1 |
281|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
282|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
Fredrik Luthander54abc352012-01-20 16:18:41 +0100283|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700284
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800285Then this user will not have `Code-Review` rights on that change,
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700286since there is an exclusive access right in place for the
287`refs/heads/qa` branch. This allows locking down access for a
288particular branch to a limited set of users, bypassing inherited
289rights and wildcards.
290
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800291In order to grant the ability to `Code-Review` to the members of
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700292`Foo Leads`, in `refs/heads/qa` then the following access rights
293would be needed:
294
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100295[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100296|==============================================================
297|Group |Reference Name|Category |Range |Exclusive
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800298|Registered Users|refs/heads/* |Code-Review| -1..+1 |
299|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
300|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
301|Foo Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100302|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700303
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200304
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800305=== OpenID Authentication
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800306
307If the Gerrit instance is configured to use OpenID authentication,
308an account's effective group membership will be restricted to only
309the `Anonymous Users` and `Registered Users` groups, unless *all*
310of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700311in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800312
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200313
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800314=== All Projects
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800315
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700316Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800317is automatically inherited by every other project in the same
318Gerrit instance. These rights can be seen, but not modified,
319in any other project's `Access` administration tab.
320
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100321Only members of the groups with the `Administrate Server` capability
322may edit the access control list for `All-Projects`. By default this
323capability is given to the group `Administrators`, but can be given
324to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700325
326Ownership of this project cannot be delegated to another group.
327This restriction is by design. Granting ownership to another
328group gives nearly the same level of access as membership in
329`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100330permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700331
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200332
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800333=== Per-Project
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800334
Fredrik Luthanderda867882011-12-21 18:28:40 +0100335The per-project ACL is evaluated before the global `All-Projects` ACL,
336permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100337behavior is generally only useful on the `Read` category when
338granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800339
340
Fredrik Luthander98030252012-04-13 11:01:22 +0200341[[references]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800342== Special and magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200343
344The reference namespaces used in git are generally two, one for branches and
345one for tags:
346
347* +refs/heads/*+
348* +refs/tags/*+
349
350However, every reference under +refs/*+ is really available, and in Gerrit this
351opportunity for giving other refs a special meaning is used. In Gerrit they
352are sometimes used as magic/virtual references that give the push to Gerrit a
353special meaning.
354
355
356[[references_special]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800357=== Special references
Fredrik Luthander98030252012-04-13 11:01:22 +0200358
359The special references have content that's either generated by Gerrit or
360contains important project configuration that Gerrit needs. When making
361changes to these references, Gerrit will take extra precautions to verify the
362contents compatibility at upload time.
363
364
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800365==== refs/changes/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200366
367Under this namespace each uploaded patch set for every change gets a static
368reference in their git. The format is convenient but still intended to scale to
369hundreds of thousands of patch sets. To access a given patch set you will
370need the change number and patch set number.
371
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800372--
Fredrik Luthander98030252012-04-13 11:01:22 +0200373'refs/changes/'<last two digits of change number>/
374 <change number>/
375 <patch set number>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800376--
Fredrik Luthander98030252012-04-13 11:01:22 +0200377
378You can also find these static references linked on the page of each change.
379
380
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800381==== refs/meta/config
Fredrik Luthander98030252012-04-13 11:01:22 +0200382
Matt Baker3a40c6d2013-11-26 21:01:17 -0700383This is where the Gerrit configuration of each project resides. This
Fredrik Luthander98030252012-04-13 11:01:22 +0200384branch contains several files of importance: +project.config+, +groups+ and
Matt Baker3a40c6d2013-11-26 21:01:17 -0700385+rules.pl+. Together they control access and behavior during the change
Fredrik Luthander98030252012-04-13 11:01:22 +0200386review process.
387
388
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800389==== refs/meta/dashboards/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200390
391There's a dedicated page where you can read more about
392link:user-dashboards.html[User Dashboards].
393
394
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800395==== refs/notes/review
Fredrik Luthander98030252012-04-13 11:01:22 +0200396
397Autogenerated copy of review notes for all changes in the git. Each log entry
398on the refs/notes/review branch also references the patch set on which the
399review is made. This functionality is provided by the review-notes plugin.
400
401
402[[references_magic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800403=== Magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200404
405These are references with added functionality to them compared to a regular
406git push operation.
407
Edwin Kempin4bf01962014-04-16 16:47:10 +0200408[[refs_for]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800409==== refs/for/<branch ref>
Fredrik Luthander98030252012-04-13 11:01:22 +0200410
411Most prominent is the `refs/for/<branch ref>` reference which is the reference
412upon which we build the code review intercept before submitting a commit to
413the branch it's uploaded to.
414
415Further documentation on how to push can be found on the
416link:user-upload.html#push_create[Upload changes] page.
417
418
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200419[[access_categories]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800420== Access Categories
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800421
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200422Gerrit has several permission categories that can be granted to groups
423within projects, enabling functionality for that group's members.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800424
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200425
Chad Horohoe029c85a2012-06-07 16:10:14 -0400426[[category_abandon]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800427=== Abandon
Chad Horohoe029c85a2012-06-07 16:10:14 -0400428
429This category controls whether users are allowed to abandon changes
430to projects in Gerrit. It can give permission to abandon a specific
431change to a given ref.
432
Aaron Gableb9b4ba92016-11-08 14:44:36 -0800433The uploader of a change, anyone granted the <<category_owner,`Owner`>>
434permission at the ref or project level, and anyone granted the
435<<capability_administrateServer,`Administrate Server`>>
436permission can also Abandon changes.
437
David Pursehousec795eb12013-07-05 14:20:28 +0900438This also grants the permission to restore a change if the user also
439has link:#category_push[push permission] on the change's destination
440ref.
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400441
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200442
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100443[[category_create]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800444=== Create Reference
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100445
446The create reference category controls whether it is possible to
447create new references, branches or tags. This implies that the
448reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900449in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100450references (and also discard any commits in the process).
451
452It's probably most common to either permit the creation of a single
453branch in many gits (by granting permission on a parent project), or
454to grant this permission to a name pattern of branches.
455
456This permission is often given in conjunction with regular push
457branch permissions, allowing the holder of both to create new branches
458as well as bypass review for new commits on that branch.
459
David Pursehouse221d4f62012-06-08 17:38:08 +0900460To push lightweight (non-annotated) tags, grant
Jonathan Nieder5758f182015-03-30 11:28:55 -0700461`Create Reference` for reference name `+refs/tags/*+`, as lightweight
Edwin Kempin94db6b62016-09-02 14:37:17 +0200462tags are implemented just like branches in Git. To push a lightweight
463tag on a new commit (commit not reachable from any branch/tag) grant
Edwin Kempin439dd1f2016-09-05 16:25:12 +0200464`Push` permission on `+refs/tags/*+` too. The `Push` permission on
465`+refs/tags/*+` also allows fast-forwarding of lightweight tags.
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100466
467For example, to grant the possibility to create new branches under the
468namespace `foo`, you have to grant this permission on
Jonathan Nieder5758f182015-03-30 11:28:55 -0700469`+refs/heads/foo/*+` for the group that should have it.
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100470Finally, if you plan to grant each user a personal namespace in
471where they are free to create as many branches as they wish, you
472should grant the create reference permission so it's possible
473to create new branches. This is done by using the special
474`${username}` keyword in the reference pattern, e.g.
Jonathan Nieder5758f182015-03-30 11:28:55 -0700475`+refs/heads/sandbox/${username}/*+`. If you do, it's also recommended
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100476you grant the users the push force permission to be able to clean up
477stale branches.
478
Edwin Kempin4666bd92016-09-07 11:43:59 +0200479[[category_delete]]
480=== Delete Reference
481
482The delete reference category controls whether it is possible to delete
483references, branches or tags. It doesn't allow any other update of
484references.
485
486Deletion of references is also possible if `Push` with the force option
487is granted, however that includes the permission to fast-forward and
Brian Bamsch2f6d7142017-05-23 14:41:30 -0700488force-update references to existing and new commits. Being able to push
Edwin Kempin4666bd92016-09-07 11:43:59 +0200489references for new commits is bad if bypassing of code review must be
490prevented.
491
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100492
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100493[[category_forge_author]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800494=== Forge Author
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100495
496Normally Gerrit requires the author and the committer identity
497lines in a Git commit object (or tagger line in an annotated tag) to
498match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100499This permission allows users to bypass parts of that validation, which
500may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100501
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100502Permits the use of an unverified author line in commit objects.
503This can be useful when applying patches received by email from
5043rd parties, when cherry-picking changes written by others across
505branches, or when amending someone else's commit to fix up a minor
506problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100507
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100508By default this is granted to `Registered Users` in all projects,
509but a site administrator may disable it if verified authorship
510is required.
511
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100512
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100513[[category_forge_committer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800514=== Forge Committer
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100515
516Normally Gerrit requires the author and the committer identity
517lines in a Git commit object (or tagger line in an annotated tag) to
518match one of the registered email addresses of the uploading user.
519This permission allows users to bypass parts of that validation, which
520may be necessary when mirroring changes from an upstream project.
521
522Allows the use of an unverified committer line in commit objects, or an
523unverified tagger line in annotated tag objects. Typically this is only
524required when mirroring commits from an upstream project repository.
525
526
527[[category_forge_server]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800528=== Forge Server
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100529
530Normally Gerrit requires the author and the committer identity
531lines in a Git commit object (or tagger line in an annotated tag) to
532match one of the registered email addresses of the uploading user.
533This permission allows users to bypass parts of that validation, which
534may be necessary when mirroring changes from an upstream project.
535
536Allows the use of the server's own name and email on the committer
537line of a new commit object. This should only be necessary when force
538pushing a commit history which has been rewritten by 'git filter-branch'
539and that contains merge commits previously created by this Gerrit Code
540Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100541
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100542
543[[category_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800544=== Owner
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100545
546The `Owner` category controls which groups can modify the project's
547configuration. Users who are members of an owner group can:
548
549* Change the project description
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100550* Grant/revoke any access rights, including `Owner`
551
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530552To get SSH branch access project owners must grant an access right to a group
553they are a member of, just like for any other user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100554
555Ownership over a particular branch subspace may be delegated by
556entering a branch pattern. To delegate control over all branches
557that begin with `qa/` to the QA group, add `Owner` category
Jonathan Nieder5758f182015-03-30 11:28:55 -0700558for reference `+refs/heads/qa/*+`. Members of the QA group can
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100559further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100560`refs/heads/qa/`. See <<project_owners,project owners>> to find
561out more about this role.
562
Edwin Kempin362fc852016-12-05 17:32:04 +0100563For the `All-Projects` root project any `Owner` access right on
564'refs/*' is ignored since this permission would allow users to edit the
565global capabilities, which is the same as being able to administrate
566the Gerrit server (e.g. the user could assign the `Administrate Server`
567capability to the own account).
568
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100569
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100570[[category_push]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800571=== Push
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100572
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100573This category controls how users are allowed to upload new commits
574to projects in Gerrit. It can either give permission to push
575directly into a branch, bypassing any code review process
576that would otherwise be used. Or it may give permission to upload
577new changes for code review, this depends on which namespace the
578permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100579
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100580[[category_push_direct]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800581==== Direct Push
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100582
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100583Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200584Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100585link:access-control.html#category_create['Create Reference']
586category. Deletion of existing branches is rejected. This is the
587safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100588
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100589* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100590+
Gert van Dijk8c5e33c2017-10-19 22:38:06 +0200591Implies <<category_delete,Delete Reference>>. Since a force push is
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100592effectively a delete immediately followed by a create, but performed
593atomically on the server and logged, this option also permits forced
594push updates to branches. Enabling this option allows existing commits
595to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100596
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100597The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100598take advantage of Gerrit's access control features and do not need
599its code review functionality. Projects that need to require code
600reviews should not grant this category.
601
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100602
Dave Borowitzaa912272018-04-24 12:48:09 -0400603[[category_push_review]]
604==== Upload To Code Review
605
606The `Push` access right granted on the namespace
607`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
608commit to the project's `refs/for/BRANCH` namespace, creating a new
609change for code review.
610
611A user must be able to clone or fetch the project in order to create
612a new commit on their local system, so in practice they must also
613have the `Read` access granted to upload a change.
614
615For an open source, public Gerrit installation, it is common to grant
616`Push` for `+refs/for/refs/heads/*+` to `Registered Users` in the
617`All-Projects` ACL. For more private installations, its common to
618grant `Push` for `+refs/for/refs/heads/*+` to all users of a project.
619
620* Force option
621+
622The force option has no function when granted to a branch in the
623`+refs/for/refs/heads/*+` namespace.
624
625
David Pursehouse596f3642016-08-31 10:25:19 +0900626[[category_add_patch_set]]
627=== Add Patch Set
628
629This category controls which users are allowed to upload new patch sets to
630existing changes. Irrespective of this permission, change owners are always
Dave Borowitz942a8fe2018-04-24 11:56:17 -0400631allowed to upload new patch sets for their changes. This permission needs to be
632set on `refs/for/*`.
David Pursehouse596f3642016-08-31 10:25:19 +0900633
Dave Borowitz942a8fe2018-04-24 11:56:17 -0400634By default, this permission is granted to `Registered Users` on `refs/for/*`,
Aaron Gablebf7f41a2016-09-20 15:25:00 -0700635allowing all registered users to upload a new patch set to any change. Revoking
636this permission (by granting it to no groups and setting the "Exclusive" flag)
637will prevent users from uploading a patch set to a change they do not own.
David Pursehouse596f3642016-08-31 10:25:19 +0900638
639
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100640[[category_push_merge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800641=== Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100642
Magnus Bäck282c1022012-04-18 15:39:17 -0400643The `Push Merge Commit` access right permits the user to upload merge
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100644commits. It's an add-on to the <<category_push,Push>> access right, and
Magnus Bäck282c1022012-04-18 15:39:17 -0400645so it won't be sufficient with only `Push Merge Commit` granted for a
646push to happen. Some projects wish to restrict merges to being created
647by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100648merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100649
Dave Borowitz942a8fe2018-04-24 11:56:17 -0400650The reference name connected to a `Push Merge Commit` entry must always
651be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
652This applies even for an entry that complements a `Push` entry for
653`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
654the intention of the `Push Merge Commit` entry is to allow direct pushes
655of merge commits.
656
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200657
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100658[[category_push_annotated]]
Edwin Kempin62c15682016-09-05 14:32:38 +0200659[[category_create_annotated]]
660=== Create Annotated Tag
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100661
David Pursehouse690cebe2012-12-12 19:22:45 +0900662This category permits users to push an annotated tag object into the
663project's repository. Typically this would be done with a command line
664such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100665
Michael Ochmannb99feab2016-07-06 14:10:22 +0200666----
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100667 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200668----
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100669
David Pursehouse690cebe2012-12-12 19:22:45 +0900670Or:
671
Michael Ochmannb99feab2016-07-06 14:10:22 +0200672----
David Pursehouse690cebe2012-12-12 19:22:45 +0900673 git push https://HOST/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200674----
David Pursehouse690cebe2012-12-12 19:22:45 +0900675
David Pursehouseb429ce12012-12-12 11:04:40 +0900676Tags must be annotated (created with `git tag -a`), should exist in
677the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100678
679This category is intended to be used to publish tags when a project
680reaches a stable release point worth remembering in history.
681
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100682It allows for a new annotated (unsigned) tag to be created. The
683tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100684
685To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100686as tags mirrored from an upstream project), `Forge Committer Identity`
Edwin Kempin62c15682016-09-05 14:32:38 +0200687must be also granted in addition to `Create Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100688
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100689To push lightweight (non annotated) tags, grant
690<<category_create,`Create Reference`>> for reference name
Jonathan Nieder5758f182015-03-30 11:28:55 -0700691`+refs/tags/*+`, as lightweight tags are implemented just like
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100692branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100693
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100694To delete or overwrite an existing tag, grant `Push` with the force
Jonathan Nieder5758f182015-03-30 11:28:55 -0700695option enabled for reference name `+refs/tags/*+`, as deleting a tag
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100696requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100697
Edwin Kempin94db6b62016-09-02 14:37:17 +0200698To push an annotated tag on a new commit (commit not reachable from any
699branch/tag) grant `Push` permission on `+refs/tags/*+` too.
Edwin Kempin439dd1f2016-09-05 16:25:12 +0200700The `Push` permission on `+refs/tags/*+` does *not* allow updating of annotated
Edwin Kempin0a41b9c2016-09-05 16:38:51 +0200701tags, not even fast-forwarding of annotated tags. Update of annotated tags
702is only allowed by granting `Push` with `force` option on `+refs/tags/*+`.
Edwin Kempin94db6b62016-09-02 14:37:17 +0200703
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100704
David Pursehouseb429ce12012-12-12 11:04:40 +0900705[[category_push_signed]]
Edwin Kempin62c15682016-09-05 14:32:38 +0200706[[category_create_signed]]
707=== Create Signed Tag
David Pursehouseb429ce12012-12-12 11:04:40 +0900708
David Pursehouse690cebe2012-12-12 19:22:45 +0900709This category permits users to push a PGP signed tag object into the
710project's repository. Typically this would be done with a command
711line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900712
Michael Ochmannb99feab2016-07-06 14:10:22 +0200713----
David Pursehouseb429ce12012-12-12 11:04:40 +0900714 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200715----
David Pursehouseb429ce12012-12-12 11:04:40 +0900716
David Pursehouse690cebe2012-12-12 19:22:45 +0900717Or:
718
Michael Ochmannb99feab2016-07-06 14:10:22 +0200719----
David Pursehouse690cebe2012-12-12 19:22:45 +0900720 git push https://HOST/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200721----
David Pursehouse690cebe2012-12-12 19:22:45 +0900722
David Pursehouseb429ce12012-12-12 11:04:40 +0900723Tags must be signed (created with `git tag -s`), should exist in the
724`refs/tags/` namespace, and should be new.
725
726
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100727[[category_read]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800728=== Read
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100729
730The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100731changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100732A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100733changes, or any of its data.
734
Nasser Grainawi990284e2019-05-24 11:12:47 -0600735[[read_special_behaviors]]
736==== Special behaviors
737
738This category has multiple special behaviors:
739
740The per-project ACL is evaluated before the global all projects ACL.
741If the per-project ACL has granted `Read` with 'DENY', and does not
742otherwise grant `Read` with 'ALLOW', then a `Read` in the all projects
743ACL is ignored. This behavior is useful to hide a handful of projects
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100744on an otherwise public server.
745
Nasser Grainawi990284e2019-05-24 11:12:47 -0600746You cannot grant `Read` on the `refs/tags/` namespace. Visibility to
747`refs/tags/` is derived from `Read` grants on refs namespaces other than
748`refs/tags/`, `refs/changes/`, and `refs/cache-automerge/` by finding
749tags reachable from those refs. For example, if a tag `refs/tags/test`
750points to a commit on the branch `refs/heads/master`, then allowing
751`Read` access to `refs/heads/master` would also allow access to
752`refs/tags/test`. If a tag is reachable from multiple refs, allowing
753access to any of those refs allows access to the tag.
754
755[[read_typical_usage]]
756==== Typical usage
757
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100758For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100759`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
760casual browsing of any project's changes, as well as fetching any
761project's repository over SSH or HTTP. New projects can be
762temporarily hidden from public view by granting `Read` with 'DENY'
763to `Anonymous Users` and granting `Read` to the project owner's
764group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100765
766For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100767source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100768typical, enabling read access only to those users who have been
769able to authenticate through the HTTP access controls. This may
770be suitable in a corporate deployment if the HTTP access control
771is already restricted to the correct set of users.
772
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100773
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200774[[category_rebase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800775=== Rebase
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200776
777This category permits users to rebase changes via the web UI by pushing
778the `Rebase Change` button.
779
780The change owner and submitters can always rebase changes in the web UI
781(even without having the `Rebase` access right assigned).
782
783Users without this access right who are able to upload new patch sets
784can still do the rebase locally and upload the rebased commit as a new
785patch set.
786
Gal Paikin6c9ed952020-01-22 10:36:35 +0100787[[category_revert]]
788=== Revert
789
790This category permits users to revert changes via the web UI by pushing
791the `Revert Change` button.
792
793Users without this access right who are able to upload changes can
794still do the revert locally and upload the revert commit as a new change.
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200795
Chad Horohoec626f3c2012-09-13 11:04:20 -0700796[[category_remove_reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800797=== Remove Reviewer
Chad Horohoec626f3c2012-09-13 11:04:20 -0700798
799This category permits users to remove other users from the list of
800reviewers on a change.
801
David Pursehouseb3d13832014-12-04 14:50:37 +0900802Change owners can always remove reviewers who have given a zero or positive
803score (even without having the `Remove Reviewer` access right assigned).
804
805Project owners and site administrators can always remove any reviewer (even
806without having the `Remove Reviewer` access right assigned).
Chad Horohoec626f3c2012-09-13 11:04:20 -0700807
808Users without this access right can only remove themselves from the
809reviewer list on a change.
810
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200811
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200812[[category_review_labels]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800813=== Review Labels
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200814
815For every configured label `My-Name` in the project, there is a
816corresponding permission `label-My-Name` with a range corresponding to
Shawn Pearce9d783122013-06-11 18:18:03 -0700817the defined values. There is also a corresponding `labelAs-My-Name`
818permission that enables editing another user's label.
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200819
820Gerrit comes pre-configured with a default 'Code-Review' label that can
821be granted to groups within projects, enabling functionality for that
822group's members. link:config-labels.html[Custom labels] may also be
823defined globally or on a per-project basis.
824
825
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100826[[category_submit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800827=== Submit
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800828
David Pursehouse6bf46ed2015-02-04 20:31:23 +0900829This category permits users to submit changes.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800830
831Submitting a change causes it to be merged into the destination
832branch as soon as possible, making it a permanent part of the
David Pursehouse22bd6f92014-02-20 21:11:01 +0900833project's history.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800834
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800835In order to submit, all labels (such as `Verified` and `Code-Review`,
836above) must enable submit, and also must not block it. See above for
837details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800838
Edwin Kempinbfa06212013-04-04 16:06:39 +0200839To link:user-upload.html#auto_merge[immediately submit a change on push]
Dave Borowitz942a8fe2018-04-24 11:56:17 -0400840the caller needs to have the Submit permission on `refs/for/<ref>`
841(e.g. on `refs/for/refs/heads/master`).
Edwin Kempinbfa06212013-04-04 16:06:39 +0200842
Edwin Kempin1493bd62016-12-02 10:12:17 +0100843Submitting to the `refs/meta/config` branch is only allowed to project
844owners. Any explicit submit permissions for non-project-owners on this
845branch are ignored. By submitting to the `refs/meta/config` branch the
846configuration of the project is changed, which can include changes to
847the access rights of the project. Allowing this to be done by a
848non-project-owner would open a security hole enabling editing of access
849rights, and thus granting of powers beyond submitting to the
850configuration.
851
David Pursehouse22bd6f92014-02-20 21:11:01 +0900852[[category_submit_on_behalf_of]]
853=== Submit (On Behalf Of)
854
855This category permits users who have also been granted the `Submit`
Dave Borowitzc6d143d2016-02-24 12:32:23 -0500856permission to submit changes on behalf of another user, by using the
857`on_behalf_of` field in link:rest-api-changes.html#submit-input[SubmitInput]
858when link:rest-api-changes.html#submit-change[submitting using the REST API].
David Pursehouse22bd6f92014-02-20 21:11:01 +0900859
860Note that this permission is named `submitAs` in the `project.config`
861file.
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100862
Edwin Kempin98ddc8a2017-02-21 11:56:08 +0100863[[category_view_private_changes]]
864=== View Private Changes
865
Edwin Kempin311be602018-12-28 14:03:50 +0100866This category permits users to view all private changes and all change edit refs.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +0100867
868The change owner and any explicitly added reviewers can always see
869private changes (even without having the `View Private Changes` access
870right assigned).
871
David Ostrovskyc3f6b142020-07-03 11:53:04 +0000872[[category_toggle_work_in_progress_state]]
873=== Toggle Work In Progress state
874
875This category controls who is able to flip the Work In Progress bit.
876
877Change owner, server administrators and project owners can always flip
878the Work In Progress bit of the change (even without having the
879`Toggle Work In Progress state` access right assigned).
David Pursehousebe7f4582012-12-12 11:21:29 +0900880
Paladox none580ae0e2017-02-12 18:15:48 +0000881[[category_delete_own_changes]]
882=== Delete Own Changes
883
884This category permits users to delete their own changes if they are not merged
885yet. This means only own changes that are open or abandoned can be deleted.
886
David Pursehouse42488f82018-07-05 13:24:47 +0900887[[category_delete_changes]]
888=== Delete Changes
889
890This category permits users to delete other users' changes if they are not merged
891yet. This means only changes that are open or abandoned can be deleted.
892
893Having this permission implies having the link:#category_delete_own_changes[
894Delete Own Changes] permission.
895
896Administrators may always delete changes without having this permission.
897
David Pursehouse59aee362012-11-15 17:25:17 +0900898[[category_edit_topic_name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800899=== Edit Topic Name
David Pursehouse59aee362012-11-15 17:25:17 +0900900
901This category permits users to edit the topic name of a change that
902is uploaded for review.
903
904The change owner, branch owners, project owners, and site administrators
905can always edit the topic name (even without having the `Edit Topic Name`
906access right assigned).
907
Edwin Kempin1f77b532013-11-08 07:16:31 +0100908Whether the topic can be edited on closed changes can be controlled
909by the 'Force Edit' flag. If this flag is not set the topic can only be
910edited on open changes.
911
David Pursehouse59aee362012-11-15 17:25:17 +0900912
David Pursehousede711702014-09-10 16:23:34 +0200913[[category_edit_hashtags]]
914=== Edit Hashtags
915
Dave Borowitzdaf0f0f2018-03-15 10:37:54 -0400916This category permits users to add or remove
917link:intro-user.html#hashtags[hashtags] on a change that is uploaded for review.
David Pursehousede711702014-09-10 16:23:34 +0200918
919The change owner, branch owners, project owners, and site administrators
920can always edit or remove hashtags (even without having the `Edit Hashtags`
921access right assigned).
922
Sven Selberga3ca6042016-09-13 16:16:54 +0200923[[category_edit_assigned_to]]
924=== Edit Assignee
925
926This category permits users to set who is assigned to a change that is
927uploaded for review.
928
929The change owner, ref owners, and the user currently assigned to a change
930can always change the assignee.
David Pursehousede711702014-09-10 16:23:34 +0200931
Edwin Kempin4bf01962014-04-16 16:47:10 +0200932[[example_roles]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800933== Examples of typical roles in a project
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100934
935Below follows a set of typical roles on a server and which access
936rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900937general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100938brand new Gerrit instance.
939
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200940
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100941[[examples_contributor]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800942=== Contributor
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100943
944This is the typical user on a public server. They are able to read
945your project and upload new changes to it. They are able to give
946feedback on other changes as well, but are unable to block or approve
947any changes.
948
949Suggested access rights to grant:
950
Nasser Grainawi990284e2019-05-24 11:12:47 -0600951* xref:category_read[`Read`] on 'refs/heads/\*'
Dave Borowitzaa912272018-04-24 12:48:09 -0400952* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800953* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100954
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100955If it's desired to have the possibility to upload temporarily hidden
956changes there's a specific permission for that. This enables someone
957to add specific reviewers for early feedback before making the change
David Ostrovsky6ffb7d92017-02-13 21:16:58 +0100958publicly visible.
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100959
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100960
Fredrik Luthander654161c2012-01-31 14:42:36 +0100961[[examples_developer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800962=== Developer
Fredrik Luthander654161c2012-01-31 14:42:36 +0100963
964This is the typical core developer on a public server. They are able
965to read the project, upload changes to a branch. They are allowed to
966push merge commits to merge branches together. Also, they are allowed
967to forge author identity, thus handling commits belonging to others
968than themselves, effectively allowing them to transfer commits
969between different branches.
970
971They are furthermore able to code review and verify commits, and
972eventually submit them. If you have an automated CI system that
973builds all uploaded patch sets you might want to skip the
974verification rights for the developer and let the CI system do that
975exclusively.
976
977Suggested access rights to grant:
978
Nasser Grainawi990284e2019-05-24 11:12:47 -0600979* xref:category_read[`Read`] on 'refs/heads/\*'
Dave Borowitzaa912272018-04-24 12:48:09 -0400980* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Dave Borowitz942a8fe2018-04-24 11:56:17 -0400981* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800982* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
983* 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 +0200984* link:config-labels.html#label_Verified[`Label: Verified`] with range '-1' to '+1' for 'refs/heads/*'
Edwin Kempin7b1897c2015-04-16 15:13:44 +0200985* xref:category_submit[`Submit`] on 'refs/heads/*'
Fredrik Luthander654161c2012-01-31 14:42:36 +0100986
987If the project is small or the developers are seasoned it might make
988sense to give them the freedom to push commits directly to a branch.
989
990Optional access rights to grant:
991
992* <<category_push,`Push`>> to 'refs/heads/*'
993* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
994
995
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100996[[examples_cisystem]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800997=== CI system
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100998
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100999A typical Continuous Integration system should be able to download new changes
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001000to build and then leave a verdict somehow.
1001
1002As an example, the popular
Marian Harbach34253372019-12-10 18:01:31 +01001003link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin,role=external,window=_blank]
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001004for Jenkins/Hudson can set labels at:
1005
1006* The start of a build
1007* A successful build
1008* An unstable build (tests fails)
1009* A failed build
1010
Peter Jönsson3bfcae72013-07-17 22:06:32 +02001011Usually the range chosen for this verdict is the `Verified` label. Depending on
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001012the size of your project and discipline of involved developers you might want
Peter Jönsson3bfcae72013-07-17 22:06:32 +02001013to limit access right to the +1 `Verified` label to the CI system only. That
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001014way it's guaranteed that submitted commits always get built and pass tests
1015successfully.
1016
1017If the build doesn't complete successfully the CI system can set the
Peter Jönsson3bfcae72013-07-17 22:06:32 +02001018`Verified` label to -1. However that means that a failed build will block
1019submit of the change even if someone else sets `Verified` +1. Depending on the
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001020project and how much the CI system can be trusted for accurate results, a
1021blocking label might not be feasible. A recommended alternative is to set the
1022label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +09001023shows a red label in the Gerrit UI. Optionally, to enable the possibility to
1024deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001025possible to set `Code-review` +1 as well.
1026
Edwin Kempina2e13cf2012-03-30 09:02:36 +02001027If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001028submitted changes for upload to other branches under certain conditions. This
1029is probably not the first step of what a project wants to automate however,
1030and so the push right can be found under the optional section.
1031
1032Suggested access rights to grant, that won't block changes:
1033
Nasser Grainawi990284e2019-05-24 11:12:47 -06001034* xref:category_read[`Read`] on 'refs/heads/\*'
Dave Borowitz01c1b1f2013-02-27 13:49:04 -08001035* 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 +02001036* link:config-labels.html#label_Verified[`Label: Verified`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001037
1038Optional access rights to grant:
1039
Dave Borowitz01c1b1f2013-02-27 13:49:04 -08001040* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Dave Borowitzaa912272018-04-24 12:48:09 -04001041* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
1042
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001043
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001044[[examples_integrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001045=== Integrator
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001046
1047Integrators are like developers but with some additional rights granted due
1048to their administrative role in a project. They can upload or push any commit
1049with any committer email (not just their own) and they can also create new
1050tags and branches.
1051
1052Suggested access rights to grant:
1053
1054* <<examples_developer,Developer rights>>
1055* <<category_push,`Push`>> to 'refs/heads/*'
1056* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +02001057* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001058* <<category_create,`Create Reference`>> to 'refs/heads/*'
Edwin Kempin62c15682016-09-05 14:32:38 +02001059* <<category_create_annotated,`Create Annotated Tag`>> to 'refs/tags/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001060
1061
Fredrik Luthander9c645362012-03-22 18:10:42 +01001062[[examples_project-owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001063=== Project owner
Fredrik Luthander9c645362012-03-22 18:10:42 +01001064
1065The project owner is almost like an integrator but with additional destructive
1066power in the form of being able to delete branches. Optionally these users
1067also have the power to configure access rights in gits assigned to them.
1068
1069[WARNING]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001070These users should be really knowledgeable about git, for instance knowing why
Fredrik Luthander9c645362012-03-22 18:10:42 +01001071tags never should be removed from a server. This role is granted potentially
1072destructive access rights and cleaning up after such a mishap could be time
1073consuming!
1074
1075Suggested access rights to grant:
1076
1077* <<examples_integrator,Integrator rights>>
1078* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
1079
1080Optional access right to grant:
1081
1082* <<category_owner,`Owner`>> in the gits they mostly work with.
1083
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001084
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001085[[examples_administrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001086=== Administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001087
1088The administrator role is the most powerful role known in the Gerrit universe.
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +01001089This role may grant itself (or others) any access right. By default the
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001090<<administrators,`Administrators` group>> is the group that has this role.
1091
1092Mandatory access rights:
1093
1094* <<capability_administrateServer,The `Administrate Server` capability>>
1095
1096Suggested access rights to grant:
1097
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +01001098* <<examples_project-owner,`Project owner rights`>>
1099* Any <<global_capabilities,`capabilities`>> needed by the administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001100
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001101
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001102== Enforcing site wide access policies
Sasa Zivkovd589f462013-02-12 14:27:09 +01001103
Jonathan Nieder5758f182015-03-30 11:28:55 -07001104By granting the <<category_owner,`Owner`>> access right on the `+refs/*+` to a
Sasa Zivkovd589f462013-02-12 14:27:09 +01001105group, Gerrit administrators can delegate the responsibility of maintaining
1106access rights for that project to that group.
1107
1108In a corporate deployment it is often necessary to enforce some access
1109policies. An example could be that no-one can update or delete a tag, not even
1110the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
1111purpose as project owners can grant themselves any access right they wish and,
1112thus, effectively override any inherited access rights from the
1113"`All-Projects`" or some other common parent project.
1114
1115What is needed is a mechanism to block a permission in a parent project so
1116that even project owners cannot allow a blocked permission in their child
1117project. Still, project owners should retain the possibility to manage all
1118non-blocked rules as they wish. This gives best of both worlds:
1119
1120* Gerrit administrators can concentrate on enforcing site wide policies
1121 and providing a meaningful set of default access permissions
1122* Project owners can manage access rights of their projects without a danger
1123 of violating a site wide policy
1124
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001125
Edwin Kempin60ab8532013-03-27 14:33:46 +01001126[[block]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001127=== 'BLOCK' access rule
Sasa Zivkovd589f462013-02-12 14:27:09 +01001128
Tyler Ciprianiefd09b62019-03-27 21:36:09 -06001129The 'BLOCK' rule can be used to take away rights from users. The BLOCK rule
1130works across project inheritance, from the top down, so an administrator can
1131use 'BLOCK' rules to enforce site-wide restrictions.
1132
1133For example, if a user in the 'Foo Users' group tries to push to
1134'refs/heads/mater' with the permissions below, that user will be blocked
1135
1136[options="header"]
1137|=========================================================================
1138|Project | Inherits From |Reference Name |Permissions |
1139|All-Projects | - |refs/* |push = block Foo Users |
1140|Foo | All-Projects |refs/heads/* |push = Foo Users |
1141|=========================================================================
1142
1143'BLOCK' rules are evaluated starting from the parent project, and after a 'BLOCK'
1144rule is found to apply, further rules are ignored. Hence, in this example, the
1145permissions on child-project is ignored.
1146
1147----
1148All-Projects: project.config
1149 [access "refs/heads/*"]
1150 push = block group X
1151
1152child-project: project.config
1153 [access "refs/heads/*"]
1154 exclusiveGroupPermissions = push
1155 push = group X
1156----
1157
1158In this case push for group 'X' will be blocked, even though the Exclusive
1159flag was set for the child-project.
Sasa Zivkovd589f462013-02-12 14:27:09 +01001160
1161A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1162force or not. A blocking force push rule blocks only force pushes, but
1163allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1164
Tyler Ciprianiefd09b62019-03-27 21:36:09 -06001165It is also possible to block label ranges. To block a group 'X' from voting
Sasa Zivkovd589f462013-02-12 14:27:09 +01001166'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1167range intact we would define:
1168
Michael Ochmannb99feab2016-07-06 14:10:22 +02001169----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001170 [access "refs/heads/*"]
1171 label-Code-Review = block -2..+2 group X
Michael Ochmannb99feab2016-07-06 14:10:22 +02001172----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001173
1174The interpretation of the 'min..max' range in case of a blocking rule is: block
1175every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1176means that the range '-1..+1' is not affected by this block.
1177
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001178=== 'BLOCK' and 'ALLOW' rules in the same access section
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001179
1180When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1181the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1182
Michael Ochmannb99feab2016-07-06 14:10:22 +02001183----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001184 [access "refs/heads/*"]
1185 push = block group X
1186 push = group Y
Michael Ochmannb99feab2016-07-06 14:10:22 +02001187----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001188
1189In this case a user which is a member of the group 'Y' will still be allowed to
1190push to 'refs/heads/*' even if it is a member of the group 'X'.
1191
Tyler Ciprianiefd09b62019-03-27 21:36:09 -06001192=== 'BLOCK' and 'ALLOW' rules in the same project with the Exclusive flag
1193
1194When a project contains a 'BLOCK' and 'ALLOW' that uses the Exclusive flag in a
1195more specific reference, the 'ALLOW' rule with the Exclusive flag will override
1196the 'BLOCK' rule:
1197
1198----
1199 [access "refs/*"]
1200 read = block group X
1201
1202 [access "refs/heads/*"]
1203 exclusiveGroupPermissions = read
1204 read = group X
1205----
1206
1207In this case a user which is a member of the group 'X' will still be allowed to
1208read 'refs/heads/*'.
1209
Michael Ochmann8129ece2016-07-08 11:25:25 +02001210[NOTE]
1211An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001212inside the same access section of the same project. An 'ALLOW' rule in a
1213different access section of the same project or in any access section in an
1214inheriting project cannot override a 'BLOCK' rule.
1215
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001216
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001217=== Examples
Sasa Zivkovd589f462013-02-12 14:27:09 +01001218
1219The following examples show some possible use cases for the 'BLOCK' rules.
1220
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001221==== Make sure no one can update or delete a tag
Sasa Zivkovd589f462013-02-12 14:27:09 +01001222
1223This requirement is quite common in a corporate deployment where
1224reproducibility of a build must be guaranteed. To achieve that we block 'push'
1225permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1226
Michael Ochmannb99feab2016-07-06 14:10:22 +02001227----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001228 [access "refs/tags/*"]
1229 push = block group Anonymous Users
Michael Ochmannb99feab2016-07-06 14:10:22 +02001230----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001231
1232By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1233everyone as everyone is a member of that group. Note that the permission to
1234create a tag is still necessary. Assuming that only <<category_owner,project
1235owners>> are allowed to create tags, we would extend the example above:
1236
Michael Ochmannb99feab2016-07-06 14:10:22 +02001237----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001238 [access "refs/tags/*"]
1239 push = block group Anonymous Users
1240 create = group Project Owners
1241 pushTag = group Project Owners
Michael Ochmannb99feab2016-07-06 14:10:22 +02001242----
Fredrik Luthander9c645362012-03-22 18:10:42 +01001243
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001244
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001245==== Let only a dedicated group vote in a special category
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001246
1247Assume there is a more restrictive process for submitting changes in stable
1248release branches which is manifested as a new voting category
1249'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1250group can vote in this category and that even project owners cannot approve
1251this category. We have to block everyone except the 'Release Engineers' to vote
1252in this category and, of course, allow 'Release Engineers' to vote in that
1253category. In the "`All-Projects`" we define the following rules:
1254
Michael Ochmannb99feab2016-07-06 14:10:22 +02001255----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001256 [access "refs/heads/stable*"]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001257 label-Release-Process = block -1..+1 group Anonymous Users
1258 label-Release-Process = -1..+1 group Release Engineers
Michael Ochmannb99feab2016-07-06 14:10:22 +02001259----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001260
David Pursehouse8becc2a2013-04-23 18:51:04 +09001261[[global_capabilities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001262== Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001263
David Pursehouse8becc2a2013-04-23 18:51:04 +09001264The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001265the server can perform which usually affect the entire
1266server in some way. The administrators may delegate these
1267capabilities to trusted groups of users.
1268
1269Delegation of capabilities allows groups to be granted a subset of
1270administrative capabilities without being given complete
1271administrative control of the server. This makes it possible to
1272keep fewer users in the administrators group, even while spreading
1273much of the server administration burden out to more users.
1274
David Pursehouse8becc2a2013-04-23 18:51:04 +09001275Global capabilities are assigned to groups in the access rights settings
1276of the root project ("`All-Projects`").
1277
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001278Below you find a list of capabilities available:
1279
1280
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001281[[capability_accessDatabase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001282=== Access Database
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001283
Edwin Kempin0f595f62018-12-10 11:48:42 +01001284Allow users to view code review metadata refs in repositories.
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001285
1286
Fredrik Luthander426885f2012-02-13 09:56:57 +01001287[[capability_administrateServer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001288=== Administrate Server
Fredrik Luthander426885f2012-02-13 09:56:57 +01001289
1290This is in effect the owner and administrator role of the Gerrit
Edwin Kempin17287422016-04-07 08:44:39 +02001291instance. Any members of a group granted this capability will be
Fredrik Luthander426885f2012-02-13 09:56:57 +01001292able to grant any access right to any group. They will also have all
1293capabilities granted to them automatically.
1294
Edwin Kempin17287422016-04-07 08:44:39 +02001295In most installations only those users who have direct filesystem and
1296database access should be granted this capability.
1297
1298This capability does not imply any other access rights. Users that have
1299this capability do not automatically get code review approval or submit
1300rights in projects. This is a feature designed to permit administrative
1301users to otherwise access Gerrit as any other normal user would,
1302without needing two different accounts.
1303
Fredrik Luthander426885f2012-02-13 09:56:57 +01001304
Bruce Zu4512fe62014-11-18 17:39:41 +08001305[[capability_batchChangesLimit]]
1306=== Batch Changes Limit
1307
1308Allow site administrators to configure the batch changes limit for
1309users to override the system config
1310link:config-gerrit.html#receive.maxBatchChanges['receive.maxBatchChanges'].
1311
1312Administrators can add a global block to `All-Projects` with group(s)
1313that should have different limits.
1314
1315When applying a batch changes limit to a user the largest value
1316granted by any of their groups is used. 0 means no limit.
1317
1318
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001319[[capability_createAccount]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001320=== Create Account
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001321
Fredrik Luthander79d38152012-03-13 09:52:22 +01001322Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001323This capability allows the granted group members to create non-interactive
1324service accounts. These service accounts are generally used for automation
1325and made to be members of the
Patrick Hiesele587c402020-08-07 16:11:29 +02001326link:access-control.html#service_users['Service users'] group.
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001327
1328
Fredrik Luthander79d38152012-03-13 09:52:22 +01001329[[capability_createGroup]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001330=== Create Group
Fredrik Luthander79d38152012-03-13 09:52:22 +01001331
1332Allow group creation. Groups are used to grant users access to different
1333actions in projects. This capability allows the granted group members to
Gal Paikinb64e25b2020-04-06 13:44:12 +02001334either link:cmd-create-group.html[create new groups via ssh] or via the web UI
1335by navigating at the top of the page to BROWSE -> Groups, and then pushing the
1336"CREATE NEW" button.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001337
1338
1339[[capability_createProject]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001340=== Create Project
Fredrik Luthander79d38152012-03-13 09:52:22 +01001341
1342Allow project creation. This capability allows the granted group to
1343either link:cmd-create-project.html[create new git projects via ssh]
1344or via the web UI.
1345
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001346
Sasa Zivkov812f4892012-06-21 16:25:21 +02001347[[capability_emailReviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001348=== Email Reviewers
Sasa Zivkov812f4892012-06-21 16:25:21 +02001349
1350Allow or deny sending email to change reviewers and watchers. This can be used
1351to deny build bots from emailing reviewers and people who watch the change.
1352Instead, only the authors of the change and those who starred it will be
1353emailed. The allow rules are evaluated before deny rules, however the default
1354is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001355
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001356
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001357[[capability_flushCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001358=== Flush Caches
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001359
Fredrik Luthander48603002012-03-21 18:17:17 +01001360Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001361group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1362
1363[NOTE]
1364This capability doesn't imply permissions to the show-caches command. For that
1365you need the <<capability_viewCaches,view caches capability>>.
1366
1367
Fredrik Luthander46843022012-03-13 16:11:02 +01001368[[capability_kill]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001369=== Kill Task
Fredrik Luthander46843022012-03-13 16:11:02 +01001370
1371Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1372kill command ends tasks that currently occupy the Gerrit server, usually
1373a replication task or a user initiated task such as an upload-pack or
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001374receive-pack.
Fredrik Luthander46843022012-03-13 16:11:02 +01001375
Dave Borowitz664d0402015-06-11 15:35:48 -04001376[[capability_maintainServer]]
1377=== Maintain Server
1378
1379Allow basic, constrained server maintenance tasks, such as flushing caches and
1380reindexing changes. Does not grant arbitrary database access, read/write, or
1381ACL management permissions, as might the
1382<<capability_administrateServer,administrate server capability>>.
1383
1384Implies the following capabilities:
1385
1386* <<capability_flushCaches,Flush Caches>>
1387* <<capability_kill,Kill Task>>
1388* <<capability_runGC,Run Garbage Collection>>
1389* <<capability_viewCaches,View Caches>>
1390* <<capability_viewQueue,View Queue>>
1391
David Ostrovskyaa49e272014-07-22 00:55:47 +02001392[[capability_modifyAccount]]
1393=== Modify Account
1394
1395Allow to link:cmd-set-account.html[modify accounts over the ssh prompt].
1396This capability allows the granted group members to modify any user account
Edwin Kempined777162017-11-15 08:23:40 -08001397setting. In addition this capability is required to view secondary emails
1398of other accounts.
Fredrik Luthander46843022012-03-13 16:11:02 +01001399
1400[[capability_priority]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001401=== Priority
Fredrik Luthander46843022012-03-13 16:11:02 +01001402
1403This capability allows users to use
1404link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
Patrick Hiesele587c402020-08-07 16:11:29 +02001405link:access-control.html#service_users['Service Users'].
Fredrik Luthander46843022012-03-13 16:11:02 +01001406It's a binary value in that granted users either have access to the thread
1407pool, or they don't.
1408
1409There are three modes for this capability and they're listed by rising
1410priority:
1411
1412No capability configured.::
1413The user isn't a member of a group with any priority capability granted. By
1414default the user is then in the 'INTERACTIVE' thread pool.
1415
1416'BATCH'::
Patrick Hiesele587c402020-08-07 16:11:29 +02001417If there's a thread pool configured for 'Service Users' and a user is
Fredrik Luthander46843022012-03-13 16:11:02 +01001418granted the priority capability with the 'BATCH' mode selected, the user ends
1419up in the separate batch user thread pool. This is true unless the user is
1420also granted the below 'INTERACTIVE' option.
1421
1422'INTERACTIVE'::
1423If a user is granted the priority capability with the 'INTERACTIVE' option,
1424regardless if they also have the 'BATCH' option or not, they are in the
1425'INTERACTIVE' thread pool.
1426
1427
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001428[[capability_queryLimit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001429=== Query Limit
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001430
1431Allow site administrators to configure the query limit for users to
1432be above the default hard-coded value of 500. Administrators can add
David Pursehouseb5d99aaf2013-08-09 11:02:48 +09001433a global block to `All-Projects` with group(s) that should have different
1434limits.
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001435
1436When applying a query limit to a user the largest value granted by
1437any of their groups is used.
1438
1439This limit applies not only to the link:cmd-query.html[`gerrit query`]
David Pursehouse799dcfe2020-05-27 11:42:44 +09001440command, but also to the web UI results pagination size.
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001441
1442
Sabari Ajay Kumarda8a8ef2018-11-24 23:40:57 -08001443[[capability_readAs]]
1444=== Read As
1445
1446Allow users to impersonate any user to see which refs they can read.
1447
1448
Shawn Pearcebb027b02013-06-10 14:35:39 -07001449[[capability_runAs]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001450=== Run As
Shawn Pearcebb027b02013-06-10 14:35:39 -07001451
Shawn Pearcef3ffd082013-06-12 11:21:35 -07001452Allow users to impersonate any other user with the `X-Gerrit-RunAs`
1453HTTP header on REST API calls, or the link:cmd-suexec.html[suexec]
1454SSH command.
1455
1456When impersonating an administrator the Administrate Server capability
1457is not honored. This security feature tries to prevent a role with
1458Run As capability from modifying the access controls in All-Projects,
1459however modification may still be possible if the impersonated user
1460has permission to push or submit changes on `refs/meta/config`. Run
1461As also blocks using most capabilities including Create User, Run
1462Garbage Collection, etc., unless the capability is also explicitly
1463granted to a group the administrator is a member of.
1464
1465Administrators do not automatically inherit this capability; it must
1466be explicitly granted.
Shawn Pearcebb027b02013-06-10 14:35:39 -07001467
1468
Edwin Kempin619169b2012-02-09 15:47:52 +01001469[[capability_runGC]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001470=== Run Garbage Collection
Edwin Kempin619169b2012-02-09 15:47:52 +01001471
1472Allow users to run the Git garbage collection for the repositories of
1473all projects.
1474
1475
Ed Bartoshd168b812013-04-13 20:15:58 +03001476[[capability_streamEvents]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001477=== Stream Events
Ed Bartoshd168b812013-04-13 20:15:58 +03001478
1479Allow performing streaming of Gerrit events. This capability
1480allows the granted group to
1481link:cmd-stream-events.html[stream Gerrit events via ssh].
1482
1483
Han-Wen Nienhuysa0ce3bb2018-04-17 14:35:10 +02001484[[capability_viewAccess]]
1485=== View Access
1486
1487Allow checking access rights for arbitrary (user, project) pairs,
1488using the link:rest-api-projects.html#check-access[check.access]
1489endpoint
1490
Dave Borowitzf3548a92014-02-20 11:02:19 -08001491[[capability_viewAllAccounts]]
1492=== View All Accounts
1493
1494Allow viewing all accounts for purposes of auto-completion, regardless
1495of link:config-gerrit.html#accounts.visibility[accounts.visibility]
1496setting.
1497
Edwin Kempined777162017-11-15 08:23:40 -08001498This capability allows to view all accounts but not all account data.
1499E.g. secondary emails of all accounts can only be viewed with the
1500link:#capability_modifyAccount[Modify Account] capability.
1501
Dave Borowitzf3548a92014-02-20 11:02:19 -08001502
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001503[[capability_viewCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001504=== View Caches
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001505
Fredrik Luthander48603002012-03-21 18:17:17 +01001506Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001507the granted group to
1508link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1509
1510
Fredrik Luthander48603002012-03-21 18:17:17 +01001511[[capability_viewConnections]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001512=== View Connections
Fredrik Luthander48603002012-03-21 18:17:17 +01001513
1514Allow querying for status of Gerrit's current client connections. This
1515capability allows the granted group to
1516link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1517
1518
Edwin Kempin362b14d12014-05-09 14:18:12 +02001519[[capability_viewPlugins]]
1520=== View Plugins
1521
1522Allow viewing the list of installed plugins.
1523
1524
Fredrik Luthander48603002012-03-21 18:17:17 +01001525[[capability_viewQueue]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001526=== View Queue
Fredrik Luthander48603002012-03-21 18:17:17 +01001527
1528Allow querying for status of Gerrit's internal task queue. This capability
1529allows the granted group to
1530link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1531
1532
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001533[[reference]]
1534== Permission evaluation reference
1535
1536Permission evaluation is expressed in the following concepts:
1537
1538* PermisssionRule: a single combination of {ALLOW, DENY, BLOCK} and
1539group, and optionally a vote range and an 'exclusive' bit.
1540
1541* Permission: groups PermissionRule by permission name. All
1542PermissionRules for same access type (eg. "read", "push") are grouped
1543into a Permission implicitly. The exclusive bit lives here.
1544
1545* AccessSection: ties a list of Permissions to a single ref pattern.
1546Each AccessSection comes from a single project.
1547
1548
1549
1550Here is how these play out in a link:config-project-config.html[project.config] file:
1551
1552----
1553 # An AccessSection
1554 [access "refs/heads/stable/*"]
1555 exclusiveGroupPermissions = create
1556
1557 # Each of the following lines corresponds to a PermissionRule
1558 # The next two PermissionRule together form the "read" Permission
1559 read = group Administrators
1560 read = group Registered Users
1561
1562 # A Permission with a block and block-override
1563 create = block group Registered Users
1564 create = group Project Owners
1565
1566 # A Permission and PermissionRule for a label
1567 label-Code-Review = -2..+2 group Project Owners
1568----
1569
1570=== Ref permissions
1571
1572Access to refs can be blocked, allowed or denied.
1573
1574==== BLOCK
1575
1576For blocking access, all rules marked BLOCK are tested, and if one
1577such rule matches, the user is denied access.
1578
1579The rules are ordered by inheritance, starting from All-Projects down.
1580Within a project, more specific ref patterns come first. The downward
1581ordering lets administrators enforce access rules across all projects
1582in a site.
1583
1584BLOCK rules can have exceptions defined on the same project (eg. BLOCK
1585anonymous users, ie. everyone, but make an exception for Admin users),
1586either by:
1587
15881. adding ALLOW PermissionRules in the same Permission. This implies
1589they apply to the same ref pattern.
1590
15912. adding an ALLOW Permission in the same project with a more specific
1592ref pattern, but marked "exclusive". This allows them to apply to
1593different ref patterns.
1594
1595Such additions not only bypass BLOCK rules, but they will also grant
1596permissions when they are processed in the ALLOW/DENY processing, as
1597described in the next subsection.
1598
1599==== ALLOW
1600
1601For allowing access, all ALLOW/DENY rules that might apply to a ref
1602are tested until one granting access is found, or until either an
1603"exclusive" rule ends the search, or all rules have been tested.
1604
1605The rules are ordered from specific ref patterns to general patterns,
1606and for equally specific patterns, from originating project up to
1607All-Projects.
1608
1609This ordering lets project owners apply permissions specific to their
1610project, overwriting the site defaults specified in All-Projects.
1611
1612==== DENY
1613
1614DENY is processed together with ALLOW.
1615
1616As said, during ALLOW/DENY processing, rules are tried out one by one.
1617For each (permission, ref-pattern, group) only a single rule
1618ALLOW/DENY rule is picked. If that first rule is a DENY rule, any
1619following ALLOW rules for the same (permission, ref-pattern, group)
1620will be ignored, canceling out their effect.
1621
1622DENY is confusing because it only works on a specific (ref-pattern,
1623group) pair. The parent project can undo the effect of a DENY rule by
1624introducing an extra rule which features a more general ref pattern or
1625a different group.
1626
1627==== DENY/ALLOW example
1628
1629Consider the ref "refs/a" and the following configuration:
1630----
1631
1632child-project: project.config
1633 [access "refs/a"]
1634 read = deny group A
1635
1636All-Projects: project.config
1637 [access "refs/a"]
1638 read = group A # ALLOW
1639 [access "refs/*"]
1640 read = group B # ALLOW
1641----
1642
1643When determining access, first "read = DENY group A" on "refs/a" is
1644encountered. The following rule to consider is "ALLOW read group A" on
1645"refs/a". The latter rule applies to the same (permission,
1646ref-pattern, group) tuple, so it it is ignored.
1647
1648The DENY rule does not affect the last rule for "refs/*", since that
1649has a different ref pattern and a different group. If group B is a
1650superset of group A, the last rule will still grant group A access to
1651"refs/a".
1652
1653
1654==== Double use of exclusive
1655
1656An 'exclusive' permission is evaluated both during BLOCK processing
1657and during ALLOW/DENY: when looking BLOCK, 'exclusive' stops the
1658search downward, while the same permission in the ALLOW/DENY
1659processing will stop looking upward for further rule matches
1660
1661==== Force permission
1662
1663The 'force' setting may be set on ALLOW and BLOCK rules. In the case
1664of ALLOW, the 'force' option makes the permission stronger (allowing
1665both forced and unforced actions). For BLOCK, the 'force' option makes
1666it weaker (the BLOCK with 'force' only blocks forced actions).
1667
1668
1669=== Labels
1670
1671Labels use the same mechanism, with the following observations:
1672
1673* The 'force' setting has no effect on label ranges.
1674
1675* BLOCK specifies the values that a group cannot vote, eg.
David Shevitzc89249b2018-09-21 10:04:20 -07001676+
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001677----
1678 label-Code-Review = block -2..+2 group Anonymous Users
1679----
David Shevitzc89249b2018-09-21 10:04:20 -07001680+
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001681prevents all users from voting -2 or +2.
1682
1683* DENY works for votes too, with the same caveats
1684
1685* The blocked vote range is the union of the all the blocked vote
1686ranges across projects, so in
David Shevitzc89249b2018-09-21 10:04:20 -07001687+
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001688----
1689All-Projects: project.config
1690 label-Code-Review = block -2..+1 group A
1691
1692Child-Project: project-config
1693 label-Code-Review = block -1..+2 group A
1694----
David Shevitzc89249b2018-09-21 10:04:20 -07001695+
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001696members of group A cannot vote at all in the Child-Project.
1697
1698
1699* The allowed vote range is the union of vote ranges allowed by all of
1700the ALLOW rules. For example, in
David Shevitzc89249b2018-09-21 10:04:20 -07001701+
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001702----
1703 label-Code-Review = -2..+1 group A
1704 label-Code-Review = -1..+2 group B
1705----
David Shevitzc89249b2018-09-21 10:04:20 -07001706+
Han-Wen Nienhuyscc3bd442018-02-01 19:30:30 +01001707a user that is both in A and B can vote -2..2.
1708
1709
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001710GERRIT
1711------
1712Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07001713
1714SEARCHBOX
1715---------