blob: 41c9dc2388aff67cd80a6ae16ba7ceda7cbe1803 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Access Controls
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08002
3Access controls in Gerrit are group based. Every user account is a
4member of one or more groups, and access and privileges are granted
Matt Fischer620255a2011-03-22 14:28:23 -05005to those groups. Access rights cannot be granted to individual
6users.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08007
8
Edwin Kempin4bf01962014-04-16 16:47:10 +02009[[system_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080010== System Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080011
Anita Kuno178f64b2014-04-22 18:52:28 -040012Gerrit comes with the following system groups:
Khai Do4245e6f2013-10-11 18:14:31 +020013
Khai Do4245e6f2013-10-11 18:14:31 +020014* Anonymous Users
15* Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020016* Project Owners
17* Registered Users
18
19The system groups are assigned special access and membership management
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -070020privileges.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080021
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020022
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010023[[anonymous_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080024=== Anonymous Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080025
26All users are automatically a member of this group. Users who are
27not signed in are a member of only this group, and no others.
28
29Any access rights assigned to this group are inherited by all users.
30
31Administrators and project owners can grant access rights to this
32group in order to permit anonymous users to view project changes,
33without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010034to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080035identity for all other operations.
36
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020037
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010038[[project_owners]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080039=== Project Owners
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010040
41Access rights assigned to this group are always evaluated within the
42context of a project to which the access rights apply. These rights
43therefore apply to all the users who are owners of this project.
44
45By assigning access rights to this group on a parent project Gerrit
46administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010047<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010048access rights where they are resolved to the users that own the child
49project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010050<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010051avoid the need to initially configure access rights for
52newly created child projects.
53
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020054
Khai Do4245e6f2013-10-11 18:14:31 +020055[[change_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080056=== Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020057
58Access rights assigned to this group are always evaluated within the
59context of a change to which the access rights apply. These rights
60therefore apply to the user who is the owner of this change.
61
62It is typical to assign a label to this group, allowing the change
63owner to vote on his change, but not actually cause it to become
64approved or rejected.
65
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010066[[registered_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080067=== Registered Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080068
69All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +010070also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080071
72Any access rights assigned to this group are inherited by all
73users as soon as they sign-in to Gerrit. If OpenID authentication
74is being employed, moving from only 'Anonymous Users' into this
75group is very easy. Caution should be taken when assigning any
76permissions to this group.
77
Dave Borowitz01c1b1f2013-02-27 13:49:04 -080078It is typical to assign `Code-Review -1..+1` to this group,
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080079allowing signed-in users to vote on a change, but not actually
80cause it to become approved or rejected.
81
82Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010083on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080084
85
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -070086== Predefined Groups
87
88Predefined groups differs from system groups by the fact that they
89exist in the ACCOUNT_GROUPS table (like normal groups) but predefined groups
90are created on Gerrit site initialization and unique UUIDs are assigned
91to those groups. These UUIDs are different on different Gerrit sites.
92
93Gerrit comes with two predefined groups:
94
95* Administrators
96* Non-Interactive Users
97
98
99[[administrators]]
100=== Administrators
101
Edwin Kempin17287422016-04-07 08:44:39 +0200102This is a predefined group, created on Gerrit site initialization, that
103has the capability link:access-control.html#capability_administrateServer[
104'Administrate Server'] assigned.
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700105
Edwin Kempin17287422016-04-07 08:44:39 +0200106It is a normal Gerrit group without magic. This means if you remove
107the 'Administrate Server' capability from it, its members are no longer
108Gerrit administrators, despite the group name. The group may also be
109renamed.
Jonathan Nieder2b2d62b2014-05-07 19:40:58 -0700110
111
112[[non-interactive_users]]
113=== Non-Interactive Users
114
115This is the Gerrit "batch" identity. The capabilities
116link:access-control.html#capability_priority['Priority BATCH'] and
117link:access-control.html#capability_streamEvents['Stream Events']
118are assigned to this predefined group on Gerrit site creation.
119
120The members of this group are not expected to perform interactive
121operations on the Gerrit web front-end.
122
123However, sometimes such a user may need a separate thread pool in
124order to prevent it from grabbing threads from the interactive users.
125
126These users live in a second thread pool, which separates operations
127made by the non-interactive users from the ones made by the interactive
128users. This ensures that the interactive users can keep working when
129resources are tight.
130
131
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800132== Account Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800133
134Account groups contain a list of zero or more user account members,
135added individually by a group owner. Any user account listed as
136a group member is given any access rights granted to the group.
137
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800138Every group has one other group designated as its owner. Users who
139are members of the owner group can:
140
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100141* Add users and other groups to this group
142* Remove users and other groups from this group
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800143* Change the name of this group
144* Change the description of this group
145* Change the owner of this group, to another group
146
147It is permissible for a group to own itself, allowing the group
148members to directly manage who their peers are.
149
150Newly created groups are automatically created as owning themselves,
151with the creating user as the only member. This permits the group
152creator to add additional members, and change the owner to another
153group if desired.
154
155It is somewhat common to create two groups at the same time,
156for example `Foo` and `Foo-admin`, where the latter group
157`Foo-admin` owns both itself and also group `Foo`. Users who
158are members of `Foo-admin` can thus control the membership of
159`Foo`, without actually having the access rights granted to `Foo`.
160This configuration can help prevent accidental submits when the
161members of `Foo` have submit rights on a project, and the members of
162`Foo-admin` typically do not need to have such rights.
163
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200164
Thanh Ha6eed43f2013-04-11 21:03:55 -0400165[[ldap_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800166== LDAP Groups
Thanh Ha6eed43f2013-04-11 21:03:55 -0400167
168LDAP groups are Account Groups that are maintained inside of your
169LDAP instance. If you are using LDAP to manage your groups they will
170not appear in the Groups list. However you can use them just like
171regular Account Groups by prefixing your group with "ldap/" in the
172Access Control for a project. For example "ldap/foo-project" will
173add the LDAP "foo-project" group to the access list.
174
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800175
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800176== Project Access Control Lists
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800177
lincolnfa7bdd32010-04-22 14:23:05 -0300178A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700179project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300180through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800181
182Per-project access control lists are also supported.
183
184Users are permitted to use the maximum range granted to any of their
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800185groups on a label. For example, a user is a member of `Foo Leads`, and
186the following ACLs are granted on a project:
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800187
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100188[options="header"]
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800189|===================================================
190|Group |Reference Name |Label |Range
191|Anonymous Users |refs/heads/* |Code-Review|-1..+1
192|Registered Users|refs/heads/* |Code-Review|-1..+2
193|Foo Leads |refs/heads/* |Code-Review|-2..0
194|===================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800195
196Then the effective range permitted to be used by the user is
197`-2..+2`, as the user is a member of all three groups (see above
198about the system groups) and the maximum range is chosen (so the
199lowest value granted to any group, and the highest value granted
200to any group).
201
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800202Reference-level access control is also possible.
203
204Permissions can be set on a single reference name to match one
205branch (e.g. `refs/heads/master`), or on a reference namespace
Jonathan Nieder5758f182015-03-30 11:28:55 -0700206(e.g. `+refs/heads/*+`) to match any branch starting with that
Sebastian Schuberth7bcfbaf2016-05-23 14:06:03 +0200207prefix. So a permission with `+refs/heads/*+` will match all of
208`refs/heads/master`, `refs/heads/experimental`, `refs/heads/release/1.0` etc.
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800209
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700210Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200211by prefixing the reference name with `^`. For example
212`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700213between 1 and 8 characters long. Within a regular expression `.`
214is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100215The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
216is used for evaluation of regular expression access control
217rules. See the library documentation for details on this
Doug Claare852eb32016-03-18 14:43:28 -0700218particular regular expression flavor. One quirk is that the
219shortest possible pattern expansion must be a valid ref name:
220thus `^refs/heads/.*/name` will fail because `refs/heads//name`
221is not a valid reference, but `^refs/heads/.+/name` will work.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700222
Edwin Kempinad6f15b2016-05-04 18:20:05 +0200223References can have the user name or the sharded account ID of the
224current user automatically included, creating dynamic access controls
225that change to match the currently logged in user. For example to
226provide a personal sandbox space to all developers,
227`+refs/heads/sandbox/${username}/*+` allows the user 'joe' to use
228'refs/heads/sandbox/joe/foo'. The sharded account ID can be used to
229give users access to their user branch in the `All-Users` repository,
230for example `+refs/users/${shardeduserid}+` is resolved to
231'refs/users/23/1011123' if the account ID of the current user is
232`1011123`.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700233
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800234When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700235the full set of access rights to determine if the user
236is allowed to perform a given action. For example, if a user is a
237member of `Foo Leads`, they are reviewing a change destined for
238the `refs/heads/qa` branch, and the following ACLs are granted
239on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800240
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100241[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100242|===============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800243|Group |Reference Name|Label |Range |Exclusive
244|Registered Users |refs/heads/* |Code-Review| -1..+1 |
245|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
246|QA Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100247|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800248
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700249Then the effective range permitted to be used by the user is
250`-2..+2`, as the user's membership of `Foo Leads` effectively grant
251them access to the entire reference space, thanks to the wildcard.
252
253Gerrit also supports exclusive reference-level access control.
254
255It is possible to configure Gerrit to grant an exclusive ref level
256access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100257an operation on a project/reference pair. This is done by ticking
258the exclusive flag when setting the permission for the
259`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700260
261For example, if a user who is a member of `Foo Leads` tries to
262review a change destined for branch `refs/heads/qa` in a project,
263and the following ACLs are granted:
264
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100265[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100266|==============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800267|Group |Reference Name|Label |Range |Exclusive
268|Registered Users|refs/heads/* |Code-Review| -1..+1 |
269|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
270|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
Fredrik Luthander54abc352012-01-20 16:18:41 +0100271|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700272
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800273Then this user will not have `Code-Review` rights on that change,
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700274since there is an exclusive access right in place for the
275`refs/heads/qa` branch. This allows locking down access for a
276particular branch to a limited set of users, bypassing inherited
277rights and wildcards.
278
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800279In order to grant the ability to `Code-Review` to the members of
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700280`Foo Leads`, in `refs/heads/qa` then the following access rights
281would be needed:
282
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100283[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100284|==============================================================
285|Group |Reference Name|Category |Range |Exclusive
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800286|Registered Users|refs/heads/* |Code-Review| -1..+1 |
287|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
288|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
289|Foo Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100290|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700291
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200292
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800293=== OpenID Authentication
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800294
295If the Gerrit instance is configured to use OpenID authentication,
296an account's effective group membership will be restricted to only
297the `Anonymous Users` and `Registered Users` groups, unless *all*
298of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700299in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800300
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200301
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800302=== All Projects
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800303
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700304Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800305is automatically inherited by every other project in the same
306Gerrit instance. These rights can be seen, but not modified,
307in any other project's `Access` administration tab.
308
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100309Only members of the groups with the `Administrate Server` capability
310may edit the access control list for `All-Projects`. By default this
311capability is given to the group `Administrators`, but can be given
312to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700313
314Ownership of this project cannot be delegated to another group.
315This restriction is by design. Granting ownership to another
316group gives nearly the same level of access as membership in
317`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100318permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700319
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200320
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800321=== Per-Project
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800322
Fredrik Luthanderda867882011-12-21 18:28:40 +0100323The per-project ACL is evaluated before the global `All-Projects` ACL,
324permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100325behavior is generally only useful on the `Read` category when
326granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800327
328
Fredrik Luthander98030252012-04-13 11:01:22 +0200329[[references]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800330== Special and magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200331
332The reference namespaces used in git are generally two, one for branches and
333one for tags:
334
335* +refs/heads/*+
336* +refs/tags/*+
337
338However, every reference under +refs/*+ is really available, and in Gerrit this
339opportunity for giving other refs a special meaning is used. In Gerrit they
340are sometimes used as magic/virtual references that give the push to Gerrit a
341special meaning.
342
343
344[[references_special]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800345=== Special references
Fredrik Luthander98030252012-04-13 11:01:22 +0200346
347The special references have content that's either generated by Gerrit or
348contains important project configuration that Gerrit needs. When making
349changes to these references, Gerrit will take extra precautions to verify the
350contents compatibility at upload time.
351
352
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800353==== refs/changes/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200354
355Under this namespace each uploaded patch set for every change gets a static
356reference in their git. The format is convenient but still intended to scale to
357hundreds of thousands of patch sets. To access a given patch set you will
358need the change number and patch set number.
359
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800360--
Fredrik Luthander98030252012-04-13 11:01:22 +0200361'refs/changes/'<last two digits of change number>/
362 <change number>/
363 <patch set number>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800364--
Fredrik Luthander98030252012-04-13 11:01:22 +0200365
366You can also find these static references linked on the page of each change.
367
368
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800369==== refs/meta/config
Fredrik Luthander98030252012-04-13 11:01:22 +0200370
Matt Baker3a40c6d2013-11-26 21:01:17 -0700371This is where the Gerrit configuration of each project resides. This
Fredrik Luthander98030252012-04-13 11:01:22 +0200372branch contains several files of importance: +project.config+, +groups+ and
Matt Baker3a40c6d2013-11-26 21:01:17 -0700373+rules.pl+. Together they control access and behavior during the change
Fredrik Luthander98030252012-04-13 11:01:22 +0200374review process.
375
376
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800377==== refs/meta/dashboards/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200378
379There's a dedicated page where you can read more about
380link:user-dashboards.html[User Dashboards].
381
382
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800383==== refs/notes/review
Fredrik Luthander98030252012-04-13 11:01:22 +0200384
385Autogenerated copy of review notes for all changes in the git. Each log entry
386on the refs/notes/review branch also references the patch set on which the
387review is made. This functionality is provided by the review-notes plugin.
388
389
390[[references_magic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800391=== Magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200392
393These are references with added functionality to them compared to a regular
394git push operation.
395
Edwin Kempin4bf01962014-04-16 16:47:10 +0200396[[refs_for]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800397==== refs/for/<branch ref>
Fredrik Luthander98030252012-04-13 11:01:22 +0200398
399Most prominent is the `refs/for/<branch ref>` reference which is the reference
400upon which we build the code review intercept before submitting a commit to
401the branch it's uploaded to.
402
403Further documentation on how to push can be found on the
404link:user-upload.html#push_create[Upload changes] page.
405
406
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800407==== refs/publish/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200408
Jonathan Nieder5758f182015-03-30 11:28:55 -0700409`+refs/publish/*+` is an alternative name to `+refs/for/*+` when pushing new changes
Fredrik Luthander98030252012-04-13 11:01:22 +0200410and patch sets.
411
412
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800413==== refs/drafts/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200414
Jonathan Nieder5758f182015-03-30 11:28:55 -0700415Push to `+refs/drafts/*+` creates a change like push to `+refs/for/*+`, except the
Fredrik Luthander98030252012-04-13 11:01:22 +0200416resulting change remains hidden from public review. You then have the option
417of adding individual reviewers before making the change public to all. The
418change page will have a 'Publish' button which allows you to convert individual
419draft patch sets of a change into public patch sets for review.
420
Jonathan Nieder5758f182015-03-30 11:28:55 -0700421To block push permission to `+refs/drafts/*+` the following permission rule can
David Ostrovsky07ddca52014-01-21 22:51:47 +0100422be configured:
423
Michael Ochmannb99feab2016-07-06 14:10:22 +0200424----
David Ostrovsky07ddca52014-01-21 22:51:47 +0100425 [access "refs/drafts/*"]
426 push = block group Anonymous Users
Michael Ochmannb99feab2016-07-06 14:10:22 +0200427----
David Ostrovsky07ddca52014-01-21 22:51:47 +0100428
Fredrik Luthander98030252012-04-13 11:01:22 +0200429
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200430[[access_categories]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800431== Access Categories
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800432
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200433Gerrit has several permission categories that can be granted to groups
434within projects, enabling functionality for that group's members.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800435
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200436
Fredrik Luthander69236de2013-05-09 14:50:39 +0200437
Chad Horohoe029c85a2012-06-07 16:10:14 -0400438[[category_abandon]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800439=== Abandon
Chad Horohoe029c85a2012-06-07 16:10:14 -0400440
441This category controls whether users are allowed to abandon changes
442to projects in Gerrit. It can give permission to abandon a specific
443change to a given ref.
444
David Pursehousec795eb12013-07-05 14:20:28 +0900445This also grants the permission to restore a change if the user also
446has link:#category_push[push permission] on the change's destination
447ref.
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400448
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200449
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100450[[category_create]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800451=== Create Reference
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100452
453The create reference category controls whether it is possible to
454create new references, branches or tags. This implies that the
455reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900456in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100457references (and also discard any commits in the process).
458
459It's probably most common to either permit the creation of a single
460branch in many gits (by granting permission on a parent project), or
461to grant this permission to a name pattern of branches.
462
463This permission is often given in conjunction with regular push
464branch permissions, allowing the holder of both to create new branches
465as well as bypass review for new commits on that branch.
466
David Pursehouse221d4f62012-06-08 17:38:08 +0900467To push lightweight (non-annotated) tags, grant
Jonathan Nieder5758f182015-03-30 11:28:55 -0700468`Create Reference` for reference name `+refs/tags/*+`, as lightweight
Edwin Kempin94db6b62016-09-02 14:37:17 +0200469tags are implemented just like branches in Git. To push a lightweight
470tag on a new commit (commit not reachable from any branch/tag) grant
Edwin Kempin439dd1f2016-09-05 16:25:12 +0200471`Push` permission on `+refs/tags/*+` too. The `Push` permission on
472`+refs/tags/*+` also allows fast-forwarding of lightweight tags.
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100473
474For example, to grant the possibility to create new branches under the
475namespace `foo`, you have to grant this permission on
Jonathan Nieder5758f182015-03-30 11:28:55 -0700476`+refs/heads/foo/*+` for the group that should have it.
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100477Finally, if you plan to grant each user a personal namespace in
478where they are free to create as many branches as they wish, you
479should grant the create reference permission so it's possible
480to create new branches. This is done by using the special
481`${username}` keyword in the reference pattern, e.g.
Jonathan Nieder5758f182015-03-30 11:28:55 -0700482`+refs/heads/sandbox/${username}/*+`. If you do, it's also recommended
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100483you grant the users the push force permission to be able to clean up
484stale branches.
485
Edwin Kempin4666bd92016-09-07 11:43:59 +0200486[[category_delete]]
487=== Delete Reference
488
489The delete reference category controls whether it is possible to delete
490references, branches or tags. It doesn't allow any other update of
491references.
492
493Deletion of references is also possible if `Push` with the force option
494is granted, however that includes the permission to fast-forward and
495force-update references to exiting and new commits. Being able to push
496references for new commits is bad if bypassing of code review must be
497prevented.
498
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100499
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100500[[category_forge_author]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800501=== Forge Author
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100502
503Normally Gerrit requires the author and the committer identity
504lines in a Git commit object (or tagger line in an annotated tag) to
505match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100506This permission allows users to bypass parts of that validation, which
507may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100508
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100509Permits the use of an unverified author line in commit objects.
510This can be useful when applying patches received by email from
5113rd parties, when cherry-picking changes written by others across
512branches, or when amending someone else's commit to fix up a minor
513problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100514
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100515By default this is granted to `Registered Users` in all projects,
516but a site administrator may disable it if verified authorship
517is required.
518
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100519
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100520[[category_forge_committer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800521=== Forge Committer
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100522
523Normally Gerrit requires the author and the committer identity
524lines in a Git commit object (or tagger line in an annotated tag) to
525match one of the registered email addresses of the uploading user.
526This permission allows users to bypass parts of that validation, which
527may be necessary when mirroring changes from an upstream project.
528
529Allows the use of an unverified committer line in commit objects, or an
530unverified tagger line in annotated tag objects. Typically this is only
531required when mirroring commits from an upstream project repository.
532
533
534[[category_forge_server]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800535=== Forge Server
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100536
537Normally Gerrit requires the author and the committer identity
538lines in a Git commit object (or tagger line in an annotated tag) to
539match one of the registered email addresses of the uploading user.
540This permission allows users to bypass parts of that validation, which
541may be necessary when mirroring changes from an upstream project.
542
543Allows the use of the server's own name and email on the committer
544line of a new commit object. This should only be necessary when force
545pushing a commit history which has been rewritten by 'git filter-branch'
546and that contains merge commits previously created by this Gerrit Code
547Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100548
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100549
550[[category_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800551=== Owner
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100552
553The `Owner` category controls which groups can modify the project's
554configuration. Users who are members of an owner group can:
555
556* Change the project description
Fredrik Luthander9c949382014-03-22 09:19:45 -0700557* Create a branch via the ssh command link:cmd-create-branch.html['create-branch']
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530558* Create/delete a branch through the web UI
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100559* Grant/revoke any access rights, including `Owner`
560
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530561To get SSH branch access project owners must grant an access right to a group
562they are a member of, just like for any other user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100563
564Ownership over a particular branch subspace may be delegated by
565entering a branch pattern. To delegate control over all branches
566that begin with `qa/` to the QA group, add `Owner` category
Jonathan Nieder5758f182015-03-30 11:28:55 -0700567for reference `+refs/heads/qa/*+`. Members of the QA group can
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100568further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100569`refs/heads/qa/`. See <<project_owners,project owners>> to find
570out more about this role.
571
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100572
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100573[[category_push]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800574=== Push
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100575
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100576This category controls how users are allowed to upload new commits
577to projects in Gerrit. It can either give permission to push
578directly into a branch, bypassing any code review process
579that would otherwise be used. Or it may give permission to upload
580new changes for code review, this depends on which namespace the
581permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100582
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100583[[category_push_direct]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800584==== Direct Push
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100585
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100586Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200587Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100588link:access-control.html#category_create['Create Reference']
589category. Deletion of existing branches is rejected. This is the
590safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100591
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100592* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100593+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100594Allows an existing branch to be deleted. Since a force push is
595effectively a delete immediately followed by a create, but performed
596atomically on the server and logged, this option also permits forced
597push updates to branches. Enabling this option allows existing commits
598to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100599
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100600The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100601take advantage of Gerrit's access control features and do not need
602its code review functionality. Projects that need to require code
603reviews should not grant this category.
604
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100605
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100606[[category_push_review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800607==== Upload To Code Review
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100608
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100609The `Push` access right granted on the namespace
610`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
611commit to the project's `refs/for/BRANCH` namespace, creating a new
612change for code review.
613
614A user must be able to clone or fetch the project in order to create
615a new commit on their local system, so in practice they must also
616have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100617
Edwin Kempind8b1b0f2016-09-30 14:13:20 +0200618For an open source, public Gerrit installation, it is common to grant
619`Push` for `+refs/for/refs/heads/*+` to `Registered Users` in the
620`All-Projects` ACL. For more private installations, its common to
621grant `Push` for `+refs/for/refs/heads/*+` to all users of a project.
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100622
623* Force option
624+
625The force option has no function when granted to a branch in the
Jonathan Nieder5758f182015-03-30 11:28:55 -0700626`+refs/for/refs/heads/*+` namespace.
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100627
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100628
David Pursehouse596f3642016-08-31 10:25:19 +0900629[[category_add_patch_set]]
630=== Add Patch Set
631
632This category controls which users are allowed to upload new patch sets to
633existing changes. Irrespective of this permission, change owners are always
634allowed to upload new patch sets for their changes. This permission needs to be
635set on `refs/for/*`.
636
Aaron Gablebf7f41a2016-09-20 15:25:00 -0700637By default, this permission is granted to `Registered Users` on `refs/for/*`,
638allowing all registered users to upload a new patch set to any change. Revoking
639this permission (by granting it to no groups and setting the "Exclusive" flag)
640will prevent users from uploading a patch set to a change they do not own.
David Pursehouse596f3642016-08-31 10:25:19 +0900641
642
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100643[[category_push_merge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800644=== Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100645
Magnus Bäck282c1022012-04-18 15:39:17 -0400646The `Push Merge Commit` access right permits the user to upload merge
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100647commits. It's an add-on to the <<category_push,Push>> access right, and
Magnus Bäck282c1022012-04-18 15:39:17 -0400648so it won't be sufficient with only `Push Merge Commit` granted for a
649push to happen. Some projects wish to restrict merges to being created
650by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100651merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100652
Jonathan Niederdaf8bd42013-10-01 15:06:14 -0700653The reference name connected to a `Push Merge Commit` entry must always
654be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
655This applies even for an entry that complements a `Push` entry for
656`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
657the intention of the `Push Merge Commit` entry is to allow direct pushes
658of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100659
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200660
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100661[[category_push_annotated]]
Edwin Kempin62c15682016-09-05 14:32:38 +0200662[[category_create_annotated]]
663=== Create Annotated Tag
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100664
David Pursehouse690cebe2012-12-12 19:22:45 +0900665This category permits users to push an annotated tag object into the
666project's repository. Typically this would be done with a command line
667such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100668
Michael Ochmannb99feab2016-07-06 14:10:22 +0200669----
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100670 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200671----
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100672
David Pursehouse690cebe2012-12-12 19:22:45 +0900673Or:
674
Michael Ochmannb99feab2016-07-06 14:10:22 +0200675----
David Pursehouse690cebe2012-12-12 19:22:45 +0900676 git push https://HOST/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200677----
David Pursehouse690cebe2012-12-12 19:22:45 +0900678
David Pursehouseb429ce12012-12-12 11:04:40 +0900679Tags must be annotated (created with `git tag -a`), should exist in
680the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100681
682This category is intended to be used to publish tags when a project
683reaches a stable release point worth remembering in history.
684
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100685It allows for a new annotated (unsigned) tag to be created. The
686tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100687
688To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100689as tags mirrored from an upstream project), `Forge Committer Identity`
Edwin Kempin62c15682016-09-05 14:32:38 +0200690must be also granted in addition to `Create Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100691
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100692To push lightweight (non annotated) tags, grant
693<<category_create,`Create Reference`>> for reference name
Jonathan Nieder5758f182015-03-30 11:28:55 -0700694`+refs/tags/*+`, as lightweight tags are implemented just like
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100695branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100696
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100697To delete or overwrite an existing tag, grant `Push` with the force
Jonathan Nieder5758f182015-03-30 11:28:55 -0700698option enabled for reference name `+refs/tags/*+`, as deleting a tag
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100699requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100700
Edwin Kempin94db6b62016-09-02 14:37:17 +0200701To push an annotated tag on a new commit (commit not reachable from any
702branch/tag) grant `Push` permission on `+refs/tags/*+` too.
Edwin Kempin439dd1f2016-09-05 16:25:12 +0200703The `Push` permission on `+refs/tags/*+` does *not* allow updating of annotated
Edwin Kempin0a41b9c2016-09-05 16:38:51 +0200704tags, not even fast-forwarding of annotated tags. Update of annotated tags
705is only allowed by granting `Push` with `force` option on `+refs/tags/*+`.
Edwin Kempin94db6b62016-09-02 14:37:17 +0200706
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100707
David Pursehouseb429ce12012-12-12 11:04:40 +0900708[[category_push_signed]]
Edwin Kempin62c15682016-09-05 14:32:38 +0200709[[category_create_signed]]
710=== Create Signed Tag
David Pursehouseb429ce12012-12-12 11:04:40 +0900711
David Pursehouse690cebe2012-12-12 19:22:45 +0900712This category permits users to push a PGP signed tag object into the
713project's repository. Typically this would be done with a command
714line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900715
Michael Ochmannb99feab2016-07-06 14:10:22 +0200716----
David Pursehouseb429ce12012-12-12 11:04:40 +0900717 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200718----
David Pursehouseb429ce12012-12-12 11:04:40 +0900719
David Pursehouse690cebe2012-12-12 19:22:45 +0900720Or:
721
Michael Ochmannb99feab2016-07-06 14:10:22 +0200722----
David Pursehouse690cebe2012-12-12 19:22:45 +0900723 git push https://HOST/PROJECT tag v1.0
Michael Ochmannb99feab2016-07-06 14:10:22 +0200724----
David Pursehouse690cebe2012-12-12 19:22:45 +0900725
David Pursehouseb429ce12012-12-12 11:04:40 +0900726Tags must be signed (created with `git tag -s`), should exist in the
727`refs/tags/` namespace, and should be new.
728
729
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100730[[category_read]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800731=== Read
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100732
733The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100734changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100735A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100736changes, or any of its data.
737
738This category has a special behavior, where the per-project ACL is
739evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100740ACL has granted `Read` with 'DENY', and does not otherwise grant
741`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100742is ignored. This behavior is useful to hide a handful of projects
743on an otherwise public server.
744
745For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100746`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
747casual browsing of any project's changes, as well as fetching any
748project's repository over SSH or HTTP. New projects can be
749temporarily hidden from public view by granting `Read` with 'DENY'
750to `Anonymous Users` and granting `Read` to the project owner's
751group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100752
753For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100754source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100755typical, enabling read access only to those users who have been
756able to authenticate through the HTTP access controls. This may
757be suitable in a corporate deployment if the HTTP access control
758is already restricted to the correct set of users.
759
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100760
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200761[[category_rebase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800762=== Rebase
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200763
764This category permits users to rebase changes via the web UI by pushing
765the `Rebase Change` button.
766
767The change owner and submitters can always rebase changes in the web UI
768(even without having the `Rebase` access right assigned).
769
770Users without this access right who are able to upload new patch sets
771can still do the rebase locally and upload the rebased commit as a new
772patch set.
773
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200774
Chad Horohoec626f3c2012-09-13 11:04:20 -0700775[[category_remove_reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800776=== Remove Reviewer
Chad Horohoec626f3c2012-09-13 11:04:20 -0700777
778This category permits users to remove other users from the list of
779reviewers on a change.
780
David Pursehouseb3d13832014-12-04 14:50:37 +0900781Change owners can always remove reviewers who have given a zero or positive
782score (even without having the `Remove Reviewer` access right assigned).
783
784Project owners and site administrators can always remove any reviewer (even
785without having the `Remove Reviewer` access right assigned).
Chad Horohoec626f3c2012-09-13 11:04:20 -0700786
787Users without this access right can only remove themselves from the
788reviewer list on a change.
789
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200790
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200791[[category_review_labels]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800792=== Review Labels
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200793
794For every configured label `My-Name` in the project, there is a
795corresponding permission `label-My-Name` with a range corresponding to
Shawn Pearce9d783122013-06-11 18:18:03 -0700796the defined values. There is also a corresponding `labelAs-My-Name`
797permission that enables editing another user's label.
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200798
799Gerrit comes pre-configured with a default 'Code-Review' label that can
800be granted to groups within projects, enabling functionality for that
801group's members. link:config-labels.html[Custom labels] may also be
802defined globally or on a per-project basis.
803
804
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100805[[category_submit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800806=== Submit
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800807
David Pursehouse6bf46ed2015-02-04 20:31:23 +0900808This category permits users to submit changes.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800809
810Submitting a change causes it to be merged into the destination
811branch as soon as possible, making it a permanent part of the
David Pursehouse22bd6f92014-02-20 21:11:01 +0900812project's history.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800813
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800814In order to submit, all labels (such as `Verified` and `Code-Review`,
815above) must enable submit, and also must not block it. See above for
816details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800817
Edwin Kempinbfa06212013-04-04 16:06:39 +0200818To link:user-upload.html#auto_merge[immediately submit a change on push]
819the caller needs to have the Submit permission on `refs/for/<ref>`
820(e.g. on `refs/for/refs/heads/master`).
821
David Pursehouse22bd6f92014-02-20 21:11:01 +0900822[[category_submit_on_behalf_of]]
823=== Submit (On Behalf Of)
824
825This category permits users who have also been granted the `Submit`
Dave Borowitzc6d143d2016-02-24 12:32:23 -0500826permission to submit changes on behalf of another user, by using the
827`on_behalf_of` field in link:rest-api-changes.html#submit-input[SubmitInput]
828when link:rest-api-changes.html#submit-change[submitting using the REST API].
David Pursehouse22bd6f92014-02-20 21:11:01 +0900829
830Note that this permission is named `submitAs` in the `project.config`
831file.
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100832
David Pursehouse5ae73002012-11-01 15:22:26 +0900833[[category_view_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800834=== View Drafts
David Pursehouse5ae73002012-11-01 15:22:26 +0900835
836This category permits users to view draft changes uploaded by other
837users.
838
839The change owner and any explicitly added reviewers can always see
840draft changes (even without having the `View Drafts` access right
841assigned).
842
843
David Pursehousebe7f4582012-12-12 11:21:29 +0900844[[category_publish_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800845=== Publish Drafts
David Pursehousebe7f4582012-12-12 11:21:29 +0900846
847This category permits users to publish draft changes uploaded by other
848users.
849
850The change owner can always publish draft changes (even without having
851the `Publish Drafts` access right assigned).
852
853
854[[category_delete_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800855=== Delete Drafts
David Pursehousebe7f4582012-12-12 11:21:29 +0900856
857This category permits users to delete draft changes uploaded by other
858users.
859
860The change owner can always delete draft changes (even without having
861the `Delete Drafts` access right assigned).
862
863
David Pursehouse59aee362012-11-15 17:25:17 +0900864[[category_edit_topic_name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800865=== Edit Topic Name
David Pursehouse59aee362012-11-15 17:25:17 +0900866
867This category permits users to edit the topic name of a change that
868is uploaded for review.
869
870The change owner, branch owners, project owners, and site administrators
871can always edit the topic name (even without having the `Edit Topic Name`
872access right assigned).
873
Edwin Kempin1f77b532013-11-08 07:16:31 +0100874Whether the topic can be edited on closed changes can be controlled
875by the 'Force Edit' flag. If this flag is not set the topic can only be
876edited on open changes.
877
David Pursehouse59aee362012-11-15 17:25:17 +0900878
David Pursehousede711702014-09-10 16:23:34 +0200879[[category_edit_hashtags]]
880=== Edit Hashtags
881
882This category permits users to add or remove hashtags on a change that
883is uploaded for review.
884
885The change owner, branch owners, project owners, and site administrators
886can always edit or remove hashtags (even without having the `Edit Hashtags`
887access right assigned).
888
Sven Selberga3ca6042016-09-13 16:16:54 +0200889[[category_edit_assigned_to]]
890=== Edit Assignee
891
892This category permits users to set who is assigned to a change that is
893uploaded for review.
894
895The change owner, ref owners, and the user currently assigned to a change
896can always change the assignee.
David Pursehousede711702014-09-10 16:23:34 +0200897
Edwin Kempin4bf01962014-04-16 16:47:10 +0200898[[example_roles]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800899== Examples of typical roles in a project
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100900
901Below follows a set of typical roles on a server and which access
902rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900903general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100904brand new Gerrit instance.
905
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200906
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100907[[examples_contributor]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800908=== Contributor
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100909
910This is the typical user on a public server. They are able to read
911your project and upload new changes to it. They are able to give
912feedback on other changes as well, but are unable to block or approve
913any changes.
914
915Suggested access rights to grant:
916
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800917* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
918* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
919* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100920
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100921If it's desired to have the possibility to upload temporarily hidden
922changes there's a specific permission for that. This enables someone
923to add specific reviewers for early feedback before making the change
David Pursehouse1ff91c02015-05-19 15:05:26 +0900924publicly visible. If you want to allow others than the owners to
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100925publish a draft you also need to grant them `Publish Drafts`.
926
927Optional access rights to grant:
928
929* xref:category_push[`Push`] to 'refs/drafts/*'
930* xref:category_publish_drafts[`Publish Drafts`] to 'refs/heads/*'
931
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100932
Fredrik Luthander654161c2012-01-31 14:42:36 +0100933[[examples_developer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800934=== Developer
Fredrik Luthander654161c2012-01-31 14:42:36 +0100935
936This is the typical core developer on a public server. They are able
937to read the project, upload changes to a branch. They are allowed to
938push merge commits to merge branches together. Also, they are allowed
939to forge author identity, thus handling commits belonging to others
940than themselves, effectively allowing them to transfer commits
941between different branches.
942
943They are furthermore able to code review and verify commits, and
944eventually submit them. If you have an automated CI system that
945builds all uploaded patch sets you might want to skip the
946verification rights for the developer and let the CI system do that
947exclusively.
948
949Suggested access rights to grant:
950
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800951* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
952* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
953* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
954* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
955* 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 +0200956* link:config-labels.html#label_Verified[`Label: Verified`] with range '-1' to '+1' for 'refs/heads/*'
Edwin Kempin7b1897c2015-04-16 15:13:44 +0200957* xref:category_submit[`Submit`] on 'refs/heads/*'
Fredrik Luthander654161c2012-01-31 14:42:36 +0100958
959If the project is small or the developers are seasoned it might make
960sense to give them the freedom to push commits directly to a branch.
961
962Optional access rights to grant:
963
964* <<category_push,`Push`>> to 'refs/heads/*'
965* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
966
967
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100968[[examples_cisystem]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800969=== CI system
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100970
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100971A typical Continuous Integration system should be able to download new changes
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100972to build and then leave a verdict somehow.
973
974As an example, the popular
975link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
976for Jenkins/Hudson can set labels at:
977
978* The start of a build
979* A successful build
980* An unstable build (tests fails)
981* A failed build
982
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200983Usually the range chosen for this verdict is the `Verified` label. Depending on
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100984the size of your project and discipline of involved developers you might want
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200985to limit access right to the +1 `Verified` label to the CI system only. That
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100986way it's guaranteed that submitted commits always get built and pass tests
987successfully.
988
989If the build doesn't complete successfully the CI system can set the
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200990`Verified` label to -1. However that means that a failed build will block
991submit of the change even if someone else sets `Verified` +1. Depending on the
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100992project and how much the CI system can be trusted for accurate results, a
993blocking label might not be feasible. A recommended alternative is to set the
994label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900995shows a red label in the Gerrit UI. Optionally, to enable the possibility to
996deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100997possible to set `Code-review` +1 as well.
998
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200999If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001000submitted changes for upload to other branches under certain conditions. This
1001is probably not the first step of what a project wants to automate however,
1002and so the push right can be found under the optional section.
1003
1004Suggested access rights to grant, that won't block changes:
1005
Dave Borowitz01c1b1f2013-02-27 13:49:04 -08001006* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
1007* 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 +02001008* link:config-labels.html#label_Verified[`Label: Verified`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001009
1010Optional access rights to grant:
1011
Dave Borowitz01c1b1f2013-02-27 13:49:04 -08001012* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
1013* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +01001014
1015
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001016[[examples_integrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001017=== Integrator
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001018
1019Integrators are like developers but with some additional rights granted due
1020to their administrative role in a project. They can upload or push any commit
1021with any committer email (not just their own) and they can also create new
1022tags and branches.
1023
1024Suggested access rights to grant:
1025
1026* <<examples_developer,Developer rights>>
1027* <<category_push,`Push`>> to 'refs/heads/*'
1028* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +02001029* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001030* <<category_create,`Create Reference`>> to 'refs/heads/*'
Edwin Kempin62c15682016-09-05 14:32:38 +02001031* <<category_create_annotated,`Create Annotated Tag`>> to 'refs/tags/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +01001032
1033
Fredrik Luthander9c645362012-03-22 18:10:42 +01001034[[examples_project-owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001035=== Project owner
Fredrik Luthander9c645362012-03-22 18:10:42 +01001036
1037The project owner is almost like an integrator but with additional destructive
1038power in the form of being able to delete branches. Optionally these users
1039also have the power to configure access rights in gits assigned to them.
1040
1041[WARNING]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001042These users should be really knowledgeable about git, for instance knowing why
Fredrik Luthander9c645362012-03-22 18:10:42 +01001043tags never should be removed from a server. This role is granted potentially
1044destructive access rights and cleaning up after such a mishap could be time
1045consuming!
1046
1047Suggested access rights to grant:
1048
1049* <<examples_integrator,Integrator rights>>
1050* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
1051
1052Optional access right to grant:
1053
1054* <<category_owner,`Owner`>> in the gits they mostly work with.
1055
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001056
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001057[[examples_administrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001058=== Administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001059
1060The administrator role is the most powerful role known in the Gerrit universe.
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +01001061This role may grant itself (or others) any access right. By default the
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001062<<administrators,`Administrators` group>> is the group that has this role.
1063
1064Mandatory access rights:
1065
1066* <<capability_administrateServer,The `Administrate Server` capability>>
1067
1068Suggested access rights to grant:
1069
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +01001070* <<examples_project-owner,`Project owner rights`>>
1071* Any <<global_capabilities,`capabilities`>> needed by the administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +01001072
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001073
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001074== Enforcing site wide access policies
Sasa Zivkovd589f462013-02-12 14:27:09 +01001075
Jonathan Nieder5758f182015-03-30 11:28:55 -07001076By granting the <<category_owner,`Owner`>> access right on the `+refs/*+` to a
Sasa Zivkovd589f462013-02-12 14:27:09 +01001077group, Gerrit administrators can delegate the responsibility of maintaining
1078access rights for that project to that group.
1079
1080In a corporate deployment it is often necessary to enforce some access
1081policies. An example could be that no-one can update or delete a tag, not even
1082the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
1083purpose as project owners can grant themselves any access right they wish and,
1084thus, effectively override any inherited access rights from the
1085"`All-Projects`" or some other common parent project.
1086
1087What is needed is a mechanism to block a permission in a parent project so
1088that even project owners cannot allow a blocked permission in their child
1089project. Still, project owners should retain the possibility to manage all
1090non-blocked rules as they wish. This gives best of both worlds:
1091
1092* Gerrit administrators can concentrate on enforcing site wide policies
1093 and providing a meaningful set of default access permissions
1094* Project owners can manage access rights of their projects without a danger
1095 of violating a site wide policy
1096
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001097
Edwin Kempin60ab8532013-03-27 14:33:46 +01001098[[block]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001099=== 'BLOCK' access rule
Sasa Zivkovd589f462013-02-12 14:27:09 +01001100
Edwin Kempin2ff687b2016-09-01 11:07:05 +02001101The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK'
1102rule cannot be overridden in the inheriting project. Any 'ALLOW' rule
1103from an inheriting project, which conflicts with an inherited 'BLOCK'
1104rule will not be honored. Searching for 'BLOCK' rules, in the chain
1105of parent projects, ignores the Exclusive flag, unless the rule with
1106the Exclusive flag is defined on the same project as the 'BLOCK'
1107rule. This means within the same project a 'BLOCK' rule can be
1108overruled by 'ALLOW' rules on the same access section and 'ALLOW'
1109rules with Exclusive flag on access section for more specific refs.
Sasa Zivkovd589f462013-02-12 14:27:09 +01001110
1111A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1112force or not. A blocking force push rule blocks only force pushes, but
1113allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1114
1115It is also possible to block label ranges. To block a group 'X' from voting
1116'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1117range intact we would define:
1118
Michael Ochmannb99feab2016-07-06 14:10:22 +02001119----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001120 [access "refs/heads/*"]
1121 label-Code-Review = block -2..+2 group X
Michael Ochmannb99feab2016-07-06 14:10:22 +02001122----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001123
1124The interpretation of the 'min..max' range in case of a blocking rule is: block
1125every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1126means that the range '-1..+1' is not affected by this block.
1127
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001128=== 'BLOCK' and 'ALLOW' rules in the same access section
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001129
1130When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1131the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1132
Michael Ochmannb99feab2016-07-06 14:10:22 +02001133----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001134 [access "refs/heads/*"]
1135 push = block group X
1136 push = group Y
Michael Ochmannb99feab2016-07-06 14:10:22 +02001137----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001138
1139In this case a user which is a member of the group 'Y' will still be allowed to
1140push to 'refs/heads/*' even if it is a member of the group 'X'.
1141
Michael Ochmann8129ece2016-07-08 11:25:25 +02001142[NOTE]
1143An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001144inside the same access section of the same project. An 'ALLOW' rule in a
1145different access section of the same project or in any access section in an
1146inheriting project cannot override a 'BLOCK' rule.
1147
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001148
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001149=== Examples
Sasa Zivkovd589f462013-02-12 14:27:09 +01001150
1151The following examples show some possible use cases for the 'BLOCK' rules.
1152
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001153==== Make sure no one can update or delete a tag
Sasa Zivkovd589f462013-02-12 14:27:09 +01001154
1155This requirement is quite common in a corporate deployment where
1156reproducibility of a build must be guaranteed. To achieve that we block 'push'
1157permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1158
Michael Ochmannb99feab2016-07-06 14:10:22 +02001159----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001160 [access "refs/tags/*"]
1161 push = block group Anonymous Users
Michael Ochmannb99feab2016-07-06 14:10:22 +02001162----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001163
1164By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1165everyone as everyone is a member of that group. Note that the permission to
1166create a tag is still necessary. Assuming that only <<category_owner,project
1167owners>> are allowed to create tags, we would extend the example above:
1168
Michael Ochmannb99feab2016-07-06 14:10:22 +02001169----
Sasa Zivkovd589f462013-02-12 14:27:09 +01001170 [access "refs/tags/*"]
1171 push = block group Anonymous Users
1172 create = group Project Owners
1173 pushTag = group Project Owners
Michael Ochmannb99feab2016-07-06 14:10:22 +02001174----
Fredrik Luthander9c645362012-03-22 18:10:42 +01001175
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001176
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001177==== Let only a dedicated group vote in a special category
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001178
1179Assume there is a more restrictive process for submitting changes in stable
1180release branches which is manifested as a new voting category
1181'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1182group can vote in this category and that even project owners cannot approve
1183this category. We have to block everyone except the 'Release Engineers' to vote
1184in this category and, of course, allow 'Release Engineers' to vote in that
1185category. In the "`All-Projects`" we define the following rules:
1186
Michael Ochmannb99feab2016-07-06 14:10:22 +02001187----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001188 [access "refs/heads/stable*"]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001189 label-Release-Process = block -1..+1 group Anonymous Users
1190 label-Release-Process = -1..+1 group Release Engineers
Michael Ochmannb99feab2016-07-06 14:10:22 +02001191----
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001192
David Pursehouse8becc2a2013-04-23 18:51:04 +09001193[[global_capabilities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001194== Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001195
David Pursehouse8becc2a2013-04-23 18:51:04 +09001196The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001197the server can perform which usually affect the entire
1198server in some way. The administrators may delegate these
1199capabilities to trusted groups of users.
1200
1201Delegation of capabilities allows groups to be granted a subset of
1202administrative capabilities without being given complete
1203administrative control of the server. This makes it possible to
1204keep fewer users in the administrators group, even while spreading
1205much of the server administration burden out to more users.
1206
David Pursehouse8becc2a2013-04-23 18:51:04 +09001207Global capabilities are assigned to groups in the access rights settings
1208of the root project ("`All-Projects`").
1209
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001210Below you find a list of capabilities available:
1211
1212
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001213[[capability_accessDatabase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001214=== Access Database
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001215
Dave Borowitzd9b8b392014-09-11 13:49:54 +02001216Allow users to access the database using the `gsql` command, and view code
1217review metadata refs in repositories.
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001218
1219
Fredrik Luthander426885f2012-02-13 09:56:57 +01001220[[capability_administrateServer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001221=== Administrate Server
Fredrik Luthander426885f2012-02-13 09:56:57 +01001222
1223This is in effect the owner and administrator role of the Gerrit
Edwin Kempin17287422016-04-07 08:44:39 +02001224instance. Any members of a group granted this capability will be
Fredrik Luthander426885f2012-02-13 09:56:57 +01001225able to grant any access right to any group. They will also have all
1226capabilities granted to them automatically.
1227
Edwin Kempin17287422016-04-07 08:44:39 +02001228In most installations only those users who have direct filesystem and
1229database access should be granted this capability.
1230
1231This capability does not imply any other access rights. Users that have
1232this capability do not automatically get code review approval or submit
1233rights in projects. This is a feature designed to permit administrative
1234users to otherwise access Gerrit as any other normal user would,
1235without needing two different accounts.
1236
Fredrik Luthander426885f2012-02-13 09:56:57 +01001237
Bruce Zu4512fe62014-11-18 17:39:41 +08001238[[capability_batchChangesLimit]]
1239=== Batch Changes Limit
1240
1241Allow site administrators to configure the batch changes limit for
1242users to override the system config
1243link:config-gerrit.html#receive.maxBatchChanges['receive.maxBatchChanges'].
1244
1245Administrators can add a global block to `All-Projects` with group(s)
1246that should have different limits.
1247
1248When applying a batch changes limit to a user the largest value
1249granted by any of their groups is used. 0 means no limit.
1250
1251
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001252[[capability_createAccount]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001253=== Create Account
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001254
Fredrik Luthander79d38152012-03-13 09:52:22 +01001255Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001256This capability allows the granted group members to create non-interactive
1257service accounts. These service accounts are generally used for automation
1258and made to be members of the
1259link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1260
1261
Fredrik Luthander79d38152012-03-13 09:52:22 +01001262[[capability_createGroup]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001263=== Create Group
Fredrik Luthander79d38152012-03-13 09:52:22 +01001264
1265Allow group creation. Groups are used to grant users access to different
1266actions in projects. This capability allows the granted group members to
1267either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1268
1269
1270[[capability_createProject]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001271=== Create Project
Fredrik Luthander79d38152012-03-13 09:52:22 +01001272
1273Allow project creation. This capability allows the granted group to
1274either link:cmd-create-project.html[create new git projects via ssh]
1275or via the web UI.
1276
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001277
Sasa Zivkov812f4892012-06-21 16:25:21 +02001278[[capability_emailReviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001279=== Email Reviewers
Sasa Zivkov812f4892012-06-21 16:25:21 +02001280
1281Allow or deny sending email to change reviewers and watchers. This can be used
1282to deny build bots from emailing reviewers and people who watch the change.
1283Instead, only the authors of the change and those who starred it will be
1284emailed. The allow rules are evaluated before deny rules, however the default
1285is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001286
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001287
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001288[[capability_flushCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001289=== Flush Caches
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001290
Fredrik Luthander48603002012-03-21 18:17:17 +01001291Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001292group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1293
1294[NOTE]
1295This capability doesn't imply permissions to the show-caches command. For that
1296you need the <<capability_viewCaches,view caches capability>>.
1297
1298
Fredrik Luthander46843022012-03-13 16:11:02 +01001299[[capability_kill]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001300=== Kill Task
Fredrik Luthander46843022012-03-13 16:11:02 +01001301
1302Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1303kill command ends tasks that currently occupy the Gerrit server, usually
1304a replication task or a user initiated task such as an upload-pack or
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001305receive-pack.
Fredrik Luthander46843022012-03-13 16:11:02 +01001306
Dave Borowitz664d0402015-06-11 15:35:48 -04001307[[capability_maintainServer]]
1308=== Maintain Server
1309
1310Allow basic, constrained server maintenance tasks, such as flushing caches and
1311reindexing changes. Does not grant arbitrary database access, read/write, or
1312ACL management permissions, as might the
1313<<capability_administrateServer,administrate server capability>>.
1314
1315Implies the following capabilities:
1316
1317* <<capability_flushCaches,Flush Caches>>
1318* <<capability_kill,Kill Task>>
1319* <<capability_runGC,Run Garbage Collection>>
1320* <<capability_viewCaches,View Caches>>
1321* <<capability_viewQueue,View Queue>>
1322
David Ostrovskyaa49e272014-07-22 00:55:47 +02001323[[capability_modifyAccount]]
1324=== Modify Account
1325
1326Allow to link:cmd-set-account.html[modify accounts over the ssh prompt].
1327This capability allows the granted group members to modify any user account
1328setting.
Fredrik Luthander46843022012-03-13 16:11:02 +01001329
1330[[capability_priority]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001331=== Priority
Fredrik Luthander46843022012-03-13 16:11:02 +01001332
1333This capability allows users to use
1334link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1335link:access-control.html#non-interactive_users['Non-Interactive Users'].
1336It's a binary value in that granted users either have access to the thread
1337pool, or they don't.
1338
1339There are three modes for this capability and they're listed by rising
1340priority:
1341
1342No capability configured.::
1343The user isn't a member of a group with any priority capability granted. By
1344default the user is then in the 'INTERACTIVE' thread pool.
1345
1346'BATCH'::
1347If there's a thread pool configured for 'Non-Interactive Users' and a user is
1348granted the priority capability with the 'BATCH' mode selected, the user ends
1349up in the separate batch user thread pool. This is true unless the user is
1350also granted the below 'INTERACTIVE' option.
1351
1352'INTERACTIVE'::
1353If a user is granted the priority capability with the 'INTERACTIVE' option,
1354regardless if they also have the 'BATCH' option or not, they are in the
1355'INTERACTIVE' thread pool.
1356
1357
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001358[[capability_queryLimit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001359=== Query Limit
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001360
1361Allow site administrators to configure the query limit for users to
1362be above the default hard-coded value of 500. Administrators can add
David Pursehouseb5d99aaf2013-08-09 11:02:48 +09001363a global block to `All-Projects` with group(s) that should have different
1364limits.
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001365
1366When applying a query limit to a user the largest value granted by
1367any of their groups is used.
1368
1369This limit applies not only to the link:cmd-query.html[`gerrit query`]
1370command, but also to the web UI results pagination size.
1371
1372
Shawn Pearcebb027b02013-06-10 14:35:39 -07001373[[capability_runAs]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001374=== Run As
Shawn Pearcebb027b02013-06-10 14:35:39 -07001375
Shawn Pearcef3ffd082013-06-12 11:21:35 -07001376Allow users to impersonate any other user with the `X-Gerrit-RunAs`
1377HTTP header on REST API calls, or the link:cmd-suexec.html[suexec]
1378SSH command.
1379
1380When impersonating an administrator the Administrate Server capability
1381is not honored. This security feature tries to prevent a role with
1382Run As capability from modifying the access controls in All-Projects,
1383however modification may still be possible if the impersonated user
1384has permission to push or submit changes on `refs/meta/config`. Run
1385As also blocks using most capabilities including Create User, Run
1386Garbage Collection, etc., unless the capability is also explicitly
1387granted to a group the administrator is a member of.
1388
1389Administrators do not automatically inherit this capability; it must
1390be explicitly granted.
Shawn Pearcebb027b02013-06-10 14:35:39 -07001391
1392
Edwin Kempin619169b2012-02-09 15:47:52 +01001393[[capability_runGC]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001394=== Run Garbage Collection
Edwin Kempin619169b2012-02-09 15:47:52 +01001395
1396Allow users to run the Git garbage collection for the repositories of
1397all projects.
1398
1399
Ed Bartoshd168b812013-04-13 20:15:58 +03001400[[capability_streamEvents]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001401=== Stream Events
Ed Bartoshd168b812013-04-13 20:15:58 +03001402
1403Allow performing streaming of Gerrit events. This capability
1404allows the granted group to
1405link:cmd-stream-events.html[stream Gerrit events via ssh].
1406
1407
Dave Borowitzf3548a92014-02-20 11:02:19 -08001408[[capability_viewAllAccounts]]
1409=== View All Accounts
1410
1411Allow viewing all accounts for purposes of auto-completion, regardless
1412of link:config-gerrit.html#accounts.visibility[accounts.visibility]
1413setting.
1414
1415
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001416[[capability_viewCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001417=== View Caches
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001418
Fredrik Luthander48603002012-03-21 18:17:17 +01001419Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001420the granted group to
1421link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1422
1423
Fredrik Luthander48603002012-03-21 18:17:17 +01001424[[capability_viewConnections]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001425=== View Connections
Fredrik Luthander48603002012-03-21 18:17:17 +01001426
1427Allow querying for status of Gerrit's current client connections. This
1428capability allows the granted group to
1429link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1430
1431
Edwin Kempin362b14d12014-05-09 14:18:12 +02001432[[capability_viewPlugins]]
1433=== View Plugins
1434
1435Allow viewing the list of installed plugins.
1436
1437
Fredrik Luthander48603002012-03-21 18:17:17 +01001438[[capability_viewQueue]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001439=== View Queue
Fredrik Luthander48603002012-03-21 18:17:17 +01001440
1441Allow querying for status of Gerrit's internal task queue. This capability
1442allows the granted group to
1443link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1444
1445
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001446GERRIT
1447------
1448Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07001449
1450SEARCHBOX
1451---------