blob: 36ec7d86ec0f81519f1dc82bc2f1a7ec32a77eb3 [file] [log] [blame]
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -08001Gerrit Code Review - Access Controls
2====================================
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
9
10System Groups
11-------------
12
Edwin Kempind2605ed2010-10-11 08:02:24 +020013Gerrit comes with 4 system groups, with special access privileges
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080014and membership management. The identity of these groups is set
15in the `system_config` table within the database, so the groups
16can be renamed after installation if desired.
17
Edwin Kempin913eab12011-05-06 08:18:24 +020018[[administrators]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080019Administrators
20~~~~~~~~~~~~~~
21
22This is the Gerrit "root" identity.
23
24Users in the 'Administrators' group can perform any action under
25the Admin menu, to any group or project, without further validation
David Pursehouse221d4f62012-06-08 17:38:08 +090026or any other access controls. In most installations only those
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080027users who have direct filesystem and database access would be
28placed into this group.
29
30Membership in the 'Administrators' group does not imply any other
31access rights. Administrators do not automatically get code review
32approval or submit rights in projects. This is a feature designed
Nico Sallembienee6eaf02010-02-01 13:24:49 -080033to permit administrative users to otherwise access Gerrit as any
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080034other normal user would, without needing two different accounts.
35
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010036[[anonymous_users]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080037Anonymous Users
38~~~~~~~~~~~~~~~
39
40All users are automatically a member of this group. Users who are
41not signed in are a member of only this group, and no others.
42
43Any access rights assigned to this group are inherited by all users.
44
45Administrators and project owners can grant access rights to this
46group in order to permit anonymous users to view project changes,
47without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010048to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080049identity for all other operations.
50
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010051[[non-interactive_users]]
52Non-Interactive Users
53~~~~~~~~~~~~~~~~~~~~~
54
55This is an internal user group, members of this group are not expected
56to perform interactive operations on the Gerrit web frontend.
57
58However, sometimes such a user may need a separate thread pool in
59order to prevent it from grabbing threads from the interactive users.
60
61These users live in a second thread pool, which separates operations
62made by the non-interactive users from the ones made by the interactive
63users. This ensures that the interactive users can keep working when
64resources are tight.
65
66[[project_owners]]
67Project Owners
68~~~~~~~~~~~~~~
69
70Access rights assigned to this group are always evaluated within the
71context of a project to which the access rights apply. These rights
72therefore apply to all the users who are owners of this project.
73
74By assigning access rights to this group on a parent project Gerrit
75administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010076<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010077access rights where they are resolved to the users that own the child
78project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010079<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010080avoid the need to initially configure access rights for
81newly created child projects.
82
83[[registered_users]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080084Registered Users
85~~~~~~~~~~~~~~~~
86
87All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +010088also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080089
90Any access rights assigned to this group are inherited by all
91users as soon as they sign-in to Gerrit. If OpenID authentication
92is being employed, moving from only 'Anonymous Users' into this
93group is very easy. Caution should be taken when assigning any
94permissions to this group.
95
Dave Borowitz01c1b1f2013-02-27 13:49:04 -080096It is typical to assign `Code-Review -1..+1` to this group,
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080097allowing signed-in users to vote on a change, but not actually
98cause it to become approved or rejected.
99
100Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100101on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800102
103
104Account Groups
105--------------
106
107Account groups contain a list of zero or more user account members,
108added individually by a group owner. Any user account listed as
109a group member is given any access rights granted to the group.
110
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800111Every group has one other group designated as its owner. Users who
112are members of the owner group can:
113
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100114* Add users and other groups to this group
115* Remove users and other groups from this group
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800116* Change the name of this group
117* Change the description of this group
118* Change the owner of this group, to another group
119
120It is permissible for a group to own itself, allowing the group
121members to directly manage who their peers are.
122
123Newly created groups are automatically created as owning themselves,
124with the creating user as the only member. This permits the group
125creator to add additional members, and change the owner to another
126group if desired.
127
128It is somewhat common to create two groups at the same time,
129for example `Foo` and `Foo-admin`, where the latter group
130`Foo-admin` owns both itself and also group `Foo`. Users who
131are members of `Foo-admin` can thus control the membership of
132`Foo`, without actually having the access rights granted to `Foo`.
133This configuration can help prevent accidental submits when the
134members of `Foo` have submit rights on a project, and the members of
135`Foo-admin` typically do not need to have such rights.
136
Thanh Ha6eed43f2013-04-11 21:03:55 -0400137[[ldap_groups]]
138LDAP Groups
139-----------
140
141LDAP groups are Account Groups that are maintained inside of your
142LDAP instance. If you are using LDAP to manage your groups they will
143not appear in the Groups list. However you can use them just like
144regular Account Groups by prefixing your group with "ldap/" in the
145Access Control for a project. For example "ldap/foo-project" will
146add the LDAP "foo-project" group to the access list.
147
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800148
149Project Access Control Lists
150----------------------------
151
lincolnfa7bdd32010-04-22 14:23:05 -0300152A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700153project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300154through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800155
156Per-project access control lists are also supported.
157
158Users are permitted to use the maximum range granted to any of their
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800159groups on a label. For example, a user is a member of `Foo Leads`, and
160the following ACLs are granted on a project:
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800161
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100162[options="header"]
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800163|===================================================
164|Group |Reference Name |Label |Range
165|Anonymous Users |refs/heads/* |Code-Review|-1..+1
166|Registered Users|refs/heads/* |Code-Review|-1..+2
167|Foo Leads |refs/heads/* |Code-Review|-2..0
168|===================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800169
170Then the effective range permitted to be used by the user is
171`-2..+2`, as the user is a member of all three groups (see above
172about the system groups) and the maximum range is chosen (so the
173lowest value granted to any group, and the highest value granted
174to any group).
175
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800176Reference-level access control is also possible.
177
178Permissions can be set on a single reference name to match one
179branch (e.g. `refs/heads/master`), or on a reference namespace
Edwin Kempina2bf0832011-09-08 14:23:30 +0200180(e.g. `refs/heads/*`) to match any branch starting with that
181prefix. So a permission with `refs/heads/*` will match
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800182`refs/heads/master` and `refs/heads/experimental`, etc.
183
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700184Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200185by prefixing the reference name with `^`. For example
186`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700187between 1 and 8 characters long. Within a regular expression `.`
188is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100189The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
190is used for evaluation of regular expression access control
191rules. See the library documentation for details on this
192particular regular expression flavor.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700193
194References can have the current user name automatically included,
195creating dynamic access controls that change to match the currently
196logged in user. For example to provide a personal sandbox space
Edwin Kempina2bf0832011-09-08 14:23:30 +0200197to all developers, `refs/heads/sandbox/${username}/*` allowing
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700198the user 'joe' to use 'refs/heads/sandbox/joe/foo'.
199
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800200When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700201the full set of access rights to determine if the user
202is allowed to perform a given action. For example, if a user is a
203member of `Foo Leads`, they are reviewing a change destined for
204the `refs/heads/qa` branch, and the following ACLs are granted
205on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800206
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100207[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100208|===============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800209|Group |Reference Name|Label |Range |Exclusive
210|Registered Users |refs/heads/* |Code-Review| -1..+1 |
211|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
212|QA Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100213|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800214
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700215Then the effective range permitted to be used by the user is
216`-2..+2`, as the user's membership of `Foo Leads` effectively grant
217them access to the entire reference space, thanks to the wildcard.
218
219Gerrit also supports exclusive reference-level access control.
220
221It is possible to configure Gerrit to grant an exclusive ref level
222access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100223an operation on a project/reference pair. This is done by ticking
224the exclusive flag when setting the permission for the
225`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700226
227For example, if a user who is a member of `Foo Leads` tries to
228review a change destined for branch `refs/heads/qa` in a project,
229and the following ACLs are granted:
230
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100231[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100232|==============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800233|Group |Reference Name|Label |Range |Exclusive
234|Registered Users|refs/heads/* |Code-Review| -1..+1 |
235|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
236|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
Fredrik Luthander54abc352012-01-20 16:18:41 +0100237|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700238
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800239Then this user will not have `Code-Review` rights on that change,
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700240since there is an exclusive access right in place for the
241`refs/heads/qa` branch. This allows locking down access for a
242particular branch to a limited set of users, bypassing inherited
243rights and wildcards.
244
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800245In order to grant the ability to `Code-Review` to the members of
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700246`Foo Leads`, in `refs/heads/qa` then the following access rights
247would be needed:
248
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100249[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100250|==============================================================
251|Group |Reference Name|Category |Range |Exclusive
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800252|Registered Users|refs/heads/* |Code-Review| -1..+1 |
253|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
254|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
255|Foo Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100256|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700257
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800258OpenID Authentication
259~~~~~~~~~~~~~~~~~~~~~
260
261If the Gerrit instance is configured to use OpenID authentication,
262an account's effective group membership will be restricted to only
263the `Anonymous Users` and `Registered Users` groups, unless *all*
264of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700265in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800266
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800267All Projects
268~~~~~~~~~~~~
269
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700270Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800271is automatically inherited by every other project in the same
272Gerrit instance. These rights can be seen, but not modified,
273in any other project's `Access` administration tab.
274
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100275Only members of the groups with the `Administrate Server` capability
276may edit the access control list for `All-Projects`. By default this
277capability is given to the group `Administrators`, but can be given
278to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700279
280Ownership of this project cannot be delegated to another group.
281This restriction is by design. Granting ownership to another
282group gives nearly the same level of access as membership in
283`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100284permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700285
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800286Per-Project
287~~~~~~~~~~~
288
Fredrik Luthanderda867882011-12-21 18:28:40 +0100289The per-project ACL is evaluated before the global `All-Projects` ACL,
290permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100291behavior is generally only useful on the `Read` category when
292granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800293
294
Fredrik Luthander98030252012-04-13 11:01:22 +0200295[[references]]
296Special and magic references
297----------------------------
298
299The reference namespaces used in git are generally two, one for branches and
300one for tags:
301
302* +refs/heads/*+
303* +refs/tags/*+
304
305However, every reference under +refs/*+ is really available, and in Gerrit this
306opportunity for giving other refs a special meaning is used. In Gerrit they
307are sometimes used as magic/virtual references that give the push to Gerrit a
308special meaning.
309
310
311[[references_special]]
312Special references
313~~~~~~~~~~~~~~~~~~
314
315The special references have content that's either generated by Gerrit or
316contains important project configuration that Gerrit needs. When making
317changes to these references, Gerrit will take extra precautions to verify the
318contents compatibility at upload time.
319
320
321refs/changes/*
322^^^^^^^^^^^^^^
323
324Under this namespace each uploaded patch set for every change gets a static
325reference in their git. The format is convenient but still intended to scale to
326hundreds of thousands of patch sets. To access a given patch set you will
327need the change number and patch set number.
328
329[verse]
330'refs/changes/'<last two digits of change number>/
331 <change number>/
332 <patch set number>
333
334You can also find these static references linked on the page of each change.
335
336
337refs/meta/config
338^^^^^^^^^^^^^^^^
339
340This is where the Gerrit configuration of each project is residing. This
341branch contains several files of importance: +project.config+, +groups+ and
342+rules.pl+. Torgether they control access and behaviour during the change
343review process.
344
345
346refs/meta/dashboards/*
347^^^^^^^^^^^^^^^^^^^^^^
348
349There's a dedicated page where you can read more about
350link:user-dashboards.html[User Dashboards].
351
352
353refs/notes/review
354^^^^^^^^^^^^^^^^^
355
356Autogenerated copy of review notes for all changes in the git. Each log entry
357on the refs/notes/review branch also references the patch set on which the
358review is made. This functionality is provided by the review-notes plugin.
359
360
361[[references_magic]]
362Magic references
363~~~~~~~~~~~~~~~~
364
365These are references with added functionality to them compared to a regular
366git push operation.
367
368
369refs/for/<branch ref>
370^^^^^^^^^^^^^^^^^^^^^
371
372Most prominent is the `refs/for/<branch ref>` reference which is the reference
373upon which we build the code review intercept before submitting a commit to
374the branch it's uploaded to.
375
376Further documentation on how to push can be found on the
377link:user-upload.html#push_create[Upload changes] page.
378
379
380refs/publish/*
381^^^^^^^^^^^^^^
382
383`refs/publish/*` is an alternative name to `refs/for/*` when pushing new changes
384and patch sets.
385
386
387refs/drafts/*
388^^^^^^^^^^^^^
389
390Push to `refs/drafts/*` creates a change like push to `refs/for/*`, except the
391resulting change remains hidden from public review. You then have the option
392of adding individual reviewers before making the change public to all. The
393change page will have a 'Publish' button which allows you to convert individual
394draft patch sets of a change into public patch sets for review.
395
396
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800397[[access_labels]]
398Review Labels
399-------------
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800400
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800401For every configured label `My-Name` in the project, there is a
402corresponding permission `label-My-Name` with a range corresponding to
403the defined values.
404
405Gerrit comes pre-configured with several default labels that can be
406granted to groups within projects, enabling functionality for that
407group's members. link:config-labels.html[Custom labels] may also be
408defined globally or on a per-project basis.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800409
Fredrik Luthander71267062011-12-21 18:38:45 +0100410With the release of the Gerrit 2.2.x series, the web GUI for ACL
411configuration was rewritten from scratch. Use this
412<<conversion_table,table>> to better understand the access rights
413conversions from the Gerrit 2.1.x to the Gerrit 2.2.x series.
414
Chad Horohoe029c85a2012-06-07 16:10:14 -0400415[[category_abandon]]
416Abandon
Edwin Kempin3ff05112012-07-19 14:43:25 +0200417~~~~~~~
Chad Horohoe029c85a2012-06-07 16:10:14 -0400418
419This category controls whether users are allowed to abandon changes
420to projects in Gerrit. It can give permission to abandon a specific
421change to a given ref.
422
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400423This also grants the permission to restore a change if the change
424can be uploaded.
425
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100426[[category_create]]
427Create reference
428~~~~~~~~~~~~~~~~
429
430The create reference category controls whether it is possible to
431create new references, branches or tags. This implies that the
432reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900433in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100434references (and also discard any commits in the process).
435
436It's probably most common to either permit the creation of a single
437branch in many gits (by granting permission on a parent project), or
438to grant this permission to a name pattern of branches.
439
440This permission is often given in conjunction with regular push
441branch permissions, allowing the holder of both to create new branches
442as well as bypass review for new commits on that branch.
443
David Pursehouse221d4f62012-06-08 17:38:08 +0900444To push lightweight (non-annotated) tags, grant
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100445`Create Reference` for reference name `refs/tags/*`, as lightweight
446tags are implemented just like branches in Git.
447
448For example, to grant the possibility to create new branches under the
449namespace `foo`, you have to grant this permission on
450`refs/heads/foo/*` for the group that should have it.
451Finally, if you plan to grant each user a personal namespace in
452where they are free to create as many branches as they wish, you
453should grant the create reference permission so it's possible
454to create new branches. This is done by using the special
455`${username}` keyword in the reference pattern, e.g.
456`refs/heads/sandbox/${username}/*`. If you do, it's also recommended
457you grant the users the push force permission to be able to clean up
458stale branches.
459
460
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100461[[category_forge_author]]
462Forge Author
463~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100464
465Normally Gerrit requires the author and the committer identity
466lines in a Git commit object (or tagger line in an annotated tag) to
467match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100468This permission allows users to bypass parts of that validation, which
469may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100470
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100471Permits the use of an unverified author line in commit objects.
472This can be useful when applying patches received by email from
4733rd parties, when cherry-picking changes written by others across
474branches, or when amending someone else's commit to fix up a minor
475problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100476
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100477By default this is granted to `Registered Users` in all projects,
478but a site administrator may disable it if verified authorship
479is required.
480
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100481
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100482[[category_forge_committer]]
483Forge Committer
484~~~~~~~~~~~~~~~
485
486Normally Gerrit requires the author and the committer identity
487lines in a Git commit object (or tagger line in an annotated tag) to
488match one of the registered email addresses of the uploading user.
489This permission allows users to bypass parts of that validation, which
490may be necessary when mirroring changes from an upstream project.
491
492Allows the use of an unverified committer line in commit objects, or an
493unverified tagger line in annotated tag objects. Typically this is only
494required when mirroring commits from an upstream project repository.
495
496
497[[category_forge_server]]
498Forge Server
499~~~~~~~~~~~~
500
501Normally Gerrit requires the author and the committer identity
502lines in a Git commit object (or tagger line in an annotated tag) to
503match one of the registered email addresses of the uploading user.
504This permission allows users to bypass parts of that validation, which
505may be necessary when mirroring changes from an upstream project.
506
507Allows the use of the server's own name and email on the committer
508line of a new commit object. This should only be necessary when force
509pushing a commit history which has been rewritten by 'git filter-branch'
510and that contains merge commits previously created by this Gerrit Code
511Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100512
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100513
514[[category_owner]]
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100515Owner
516~~~~~
517
518The `Owner` category controls which groups can modify the project's
519configuration. Users who are members of an owner group can:
520
521* Change the project description
522* Create/delete a branch through the web UI (not SSH)
523* Grant/revoke any access rights, including `Owner`
524
525Note that project owners implicitly have branch creation or deletion
526through the web UI, but not through SSH. To get SSH branch access
527project owners must grant an access right to a group they are a
528member of, just like for any other user.
529
530Ownership over a particular branch subspace may be delegated by
531entering a branch pattern. To delegate control over all branches
532that begin with `qa/` to the QA group, add `Owner` category
Fredrik Luthandera8b9d212012-10-10 16:05:59 +0200533for reference `refs/heads/qa/*`. Members of the QA group can
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100534further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100535`refs/heads/qa/`. See <<project_owners,project owners>> to find
536out more about this role.
537
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100538
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100539[[category_push]]
540Push
541~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100542
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100543This category controls how users are allowed to upload new commits
544to projects in Gerrit. It can either give permission to push
545directly into a branch, bypassing any code review process
546that would otherwise be used. Or it may give permission to upload
547new changes for code review, this depends on which namespace the
548permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100549
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100550
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100551[[category_push_direct]]
552Direct Push
553^^^^^^^^^^^
554
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100555Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200556Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100557link:access-control.html#category_create['Create Reference']
558category. Deletion of existing branches is rejected. This is the
559safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100560
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100561* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100562+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100563Allows an existing branch to be deleted. Since a force push is
564effectively a delete immediately followed by a create, but performed
565atomically on the server and logged, this option also permits forced
566push updates to branches. Enabling this option allows existing commits
567to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100568
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100569The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100570take advantage of Gerrit's access control features and do not need
571its code review functionality. Projects that need to require code
572reviews should not grant this category.
573
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100574
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100575[[category_push_review]]
576Upload To Code Review
577^^^^^^^^^^^^^^^^^^^^^
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100578
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100579The `Push` access right granted on the namespace
580`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
581commit to the project's `refs/for/BRANCH` namespace, creating a new
582change for code review.
583
584A user must be able to clone or fetch the project in order to create
585a new commit on their local system, so in practice they must also
586have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100587
588For an open source, public Gerrit installation, it is common to
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100589grant `Read` and `Push` for `refs/for/refs/heads/*`
590to `Registered Users` in the `All-Projects` ACL. For more
591private installations, its common to simply grant `Read` and
592`Push` for `refs/for/refs/heads/*` to all users of a project.
593
594* Force option
595+
596The force option has no function when granted to a branch in the
597`refs/for/refs/heads/*` namespace.
598
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100599
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100600[[category_push_merge]]
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100601Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100602~~~~~~~~~~~~~~~~~~~~
603
Magnus Bäck282c1022012-04-18 15:39:17 -0400604The `Push Merge Commit` access right permits the user to upload merge
605commits. It's an addon to the <<category_push,Push>> access right, and
606so it won't be sufficient with only `Push Merge Commit` granted for a
607push to happen. Some projects wish to restrict merges to being created
608by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100609merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100610
Magnus Bäck282c1022012-04-18 15:39:17 -0400611The reference name connected to a `Push Merge Commit` entry must always
612be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
613This applies even for an entry that complements a `Push` entry for
614`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
615the intention of the `Push Merge Commit` entry is to allow direct pushes
616of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100617
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100618[[category_push_annotated]]
619Push Annotated Tag
620~~~~~~~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100621
David Pursehouse690cebe2012-12-12 19:22:45 +0900622This category permits users to push an annotated tag object into the
623project's repository. Typically this would be done with a command line
624such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100625
626====
627 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
628====
629
David Pursehouse690cebe2012-12-12 19:22:45 +0900630Or:
631
632====
633 git push https://HOST/PROJECT tag v1.0
634====
635
David Pursehouseb429ce12012-12-12 11:04:40 +0900636Tags must be annotated (created with `git tag -a`), should exist in
637the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100638
639This category is intended to be used to publish tags when a project
640reaches a stable release point worth remembering in history.
641
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100642It allows for a new annotated (unsigned) tag to be created. The
643tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100644
645To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100646as tags mirrored from an upstream project), `Forge Committer Identity`
647must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100648
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100649To push lightweight (non annotated) tags, grant
650<<category_create,`Create Reference`>> for reference name
651`refs/tags/*`, as lightweight tags are implemented just like
652branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100653
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100654To delete or overwrite an existing tag, grant `Push` with the force
655option enabled for reference name `refs/tags/*`, as deleting a tag
656requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100657
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100658
David Pursehouseb429ce12012-12-12 11:04:40 +0900659[[category_push_signed]]
660Push Signed Tag
661~~~~~~~~~~~~~~~
662
David Pursehouse690cebe2012-12-12 19:22:45 +0900663This category permits users to push a PGP signed tag object into the
664project's repository. Typically this would be done with a command
665line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900666
667====
668 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
669====
670
David Pursehouse690cebe2012-12-12 19:22:45 +0900671Or:
672
673====
674 git push https://HOST/PROJECT tag v1.0
675====
676
David Pursehouseb429ce12012-12-12 11:04:40 +0900677Tags must be signed (created with `git tag -s`), should exist in the
678`refs/tags/` namespace, and should be new.
679
680
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100681[[category_read]]
682Read
683~~~~
684
685The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100686changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100687A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100688changes, or any of its data.
689
690This category has a special behavior, where the per-project ACL is
691evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100692ACL has granted `Read` with 'DENY', and does not otherwise grant
693`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100694is ignored. This behavior is useful to hide a handful of projects
695on an otherwise public server.
696
697For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100698`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
699casual browsing of any project's changes, as well as fetching any
700project's repository over SSH or HTTP. New projects can be
701temporarily hidden from public view by granting `Read` with 'DENY'
702to `Anonymous Users` and granting `Read` to the project owner's
703group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100704
705For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100706source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100707typical, enabling read access only to those users who have been
708able to authenticate through the HTTP access controls. This may
709be suitable in a corporate deployment if the HTTP access control
710is already restricted to the correct set of users.
711
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100712
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200713[[category_rebase]]
714Rebase
715~~~~~~
716
717This category permits users to rebase changes via the web UI by pushing
718the `Rebase Change` button.
719
720The change owner and submitters can always rebase changes in the web UI
721(even without having the `Rebase` access right assigned).
722
723Users without this access right who are able to upload new patch sets
724can still do the rebase locally and upload the rebased commit as a new
725patch set.
726
Chad Horohoec626f3c2012-09-13 11:04:20 -0700727[[category_remove_reviewer]]
728Remove Reviewer
729~~~~~~~~~~~~~~~
730
731This category permits users to remove other users from the list of
732reviewers on a change.
733
734The change owner, project owner and site administrator can always
735remove reviewers (even without having the `Remove Reviewer` access
736right assigned).
737
738Users without this access right can only remove themselves from the
739reviewer list on a change.
740
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200741
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100742[[category_submit]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800743Submit
744~~~~~~
745
746This category permits users to push the `Submit Patch Set n` button
747on the web UI.
748
749Submitting a change causes it to be merged into the destination
750branch as soon as possible, making it a permanent part of the
751project's history.
752
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800753In order to submit, all labels (such as `Verified` and `Code-Review`,
754above) must enable submit, and also must not block it. See above for
755details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800756
Edwin Kempinbfa06212013-04-04 16:06:39 +0200757To link:user-upload.html#auto_merge[immediately submit a change on push]
758the caller needs to have the Submit permission on `refs/for/<ref>`
759(e.g. on `refs/for/refs/heads/master`).
760
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100761
David Pursehouse5ae73002012-11-01 15:22:26 +0900762[[category_view_drafts]]
763View Drafts
764~~~~~~~~~~~
765
766This category permits users to view draft changes uploaded by other
767users.
768
769The change owner and any explicitly added reviewers can always see
770draft changes (even without having the `View Drafts` access right
771assigned).
772
773
David Pursehousebe7f4582012-12-12 11:21:29 +0900774[[category_publish_drafts]]
775Publish Drafts
776~~~~~~~~~~~~~~
777
778This category permits users to publish draft changes uploaded by other
779users.
780
781The change owner can always publish draft changes (even without having
782the `Publish Drafts` access right assigned).
783
784
785[[category_delete_drafts]]
786Delete Drafts
787~~~~~~~~~~~~~
788
789This category permits users to delete draft changes uploaded by other
790users.
791
792The change owner can always delete draft changes (even without having
793the `Delete Drafts` access right assigned).
794
795
David Pursehouse59aee362012-11-15 17:25:17 +0900796[[category_edit_topic_name]]
797Edit Topic Name
798~~~~~~~~~~~~~~~
799
800This category permits users to edit the topic name of a change that
801is uploaded for review.
802
803The change owner, branch owners, project owners, and site administrators
804can always edit the topic name (even without having the `Edit Topic Name`
805access right assigned).
806
807
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100808Examples of typical roles in a project
809--------------------------------------
810
811Below follows a set of typical roles on a server and which access
812rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900813general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100814brand new Gerrit instance.
815
816[[examples_contributor]]
817Contributor
818~~~~~~~~~~~
819
820This is the typical user on a public server. They are able to read
821your project and upload new changes to it. They are able to give
822feedback on other changes as well, but are unable to block or approve
823any changes.
824
825Suggested access rights to grant:
826
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800827* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
828* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
829* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100830
831
Fredrik Luthander654161c2012-01-31 14:42:36 +0100832[[examples_developer]]
833Developer
834~~~~~~~~~
835
836This is the typical core developer on a public server. They are able
837to read the project, upload changes to a branch. They are allowed to
838push merge commits to merge branches together. Also, they are allowed
839to forge author identity, thus handling commits belonging to others
840than themselves, effectively allowing them to transfer commits
841between different branches.
842
843They are furthermore able to code review and verify commits, and
844eventually submit them. If you have an automated CI system that
845builds all uploaded patch sets you might want to skip the
846verification rights for the developer and let the CI system do that
847exclusively.
848
849Suggested access rights to grant:
850
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800851* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
852* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
853* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
854* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
855* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-2' to '+2' for 'refs/heads/*'
856* link:config-labels.html#label_Verified[`Label: Verify`] with range '-1' to '+1' for 'refs/heads/*'
857* xref:category_submit[`Submit`]
Fredrik Luthander654161c2012-01-31 14:42:36 +0100858
859If the project is small or the developers are seasoned it might make
860sense to give them the freedom to push commits directly to a branch.
861
862Optional access rights to grant:
863
864* <<category_push,`Push`>> to 'refs/heads/*'
865* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
866
867
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100868[[examples_cisystem]]
869CI system
870~~~~~~~~~
871
872A typical Continous Integration system should be able to download new changes
873to build and then leave a verdict somehow.
874
875As an example, the popular
876link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
877for Jenkins/Hudson can set labels at:
878
879* The start of a build
880* A successful build
881* An unstable build (tests fails)
882* A failed build
883
884Usually the range chosen for this verdict is the verify label. Depending on
885the size of your project and discipline of involved developers you might want
886to limit access right to the +1 `Verify` label to the CI system only. That
887way it's guaranteed that submitted commits always get built and pass tests
888successfully.
889
890If the build doesn't complete successfully the CI system can set the
891`Verify` label to -1. However that means that a failed build will block
892submit of the change even if someone else sets `Verify` +1. Depending on the
893project and how much the CI system can be trusted for accurate results, a
894blocking label might not be feasible. A recommended alternative is to set the
895label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900896shows a red label in the Gerrit UI. Optionally, to enable the possibility to
897deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100898possible to set `Code-review` +1 as well.
899
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200900If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100901submitted changes for upload to other branches under certain conditions. This
902is probably not the first step of what a project wants to automate however,
903and so the push right can be found under the optional section.
904
905Suggested access rights to grant, that won't block changes:
906
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800907* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
908* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '0' for 'refs/heads/*'
909* link:config-labels.html#label_Verified[`Label: Verify`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100910
911Optional access rights to grant:
912
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800913* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
914* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100915
916
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100917[[examples_integrator]]
918Integrator
919~~~~~~~~~~
920
921Integrators are like developers but with some additional rights granted due
922to their administrative role in a project. They can upload or push any commit
923with any committer email (not just their own) and they can also create new
924tags and branches.
925
926Suggested access rights to grant:
927
928* <<examples_developer,Developer rights>>
929* <<category_push,`Push`>> to 'refs/heads/*'
930* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200931* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100932* <<category_create,`Create Reference`>> to 'refs/heads/*'
933* <<category_push_annotated,`Push Annotated Tag`>> to 'refs/tags/*'
934
935
Fredrik Luthander9c645362012-03-22 18:10:42 +0100936[[examples_project-owner]]
937Project owner
938~~~~~~~~~~~~~
939
940The project owner is almost like an integrator but with additional destructive
941power in the form of being able to delete branches. Optionally these users
942also have the power to configure access rights in gits assigned to them.
943
944[WARNING]
945These users should be really knowledgable about git, for instance knowing why
946tags never should be removed from a server. This role is granted potentially
947destructive access rights and cleaning up after such a mishap could be time
948consuming!
949
950Suggested access rights to grant:
951
952* <<examples_integrator,Integrator rights>>
953* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
954
955Optional access right to grant:
956
957* <<category_owner,`Owner`>> in the gits they mostly work with.
958
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100959[[examples_administrator]]
960Administrator
961~~~~~~~~~~~~~
962
963The administrator role is the most powerful role known in the Gerrit universe.
964This role may grant itself (or others) any access right, and it already has
965all capabilities granted as well. By default the
966<<administrators,`Administrators` group>> is the group that has this role.
967
968Mandatory access rights:
969
970* <<capability_administrateServer,The `Administrate Server` capability>>
971
972Suggested access rights to grant:
973
974* <<examples_project-owner,Project owner rights>>
975
Sasa Zivkovd589f462013-02-12 14:27:09 +0100976Enforcing site wide access policies
977-----------------------------------
978
979By granting the <<category_owner,`Owner`>> access right on the `refs/*` to a
980group, Gerrit administrators can delegate the responsibility of maintaining
981access rights for that project to that group.
982
983In a corporate deployment it is often necessary to enforce some access
984policies. An example could be that no-one can update or delete a tag, not even
985the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
986purpose as project owners can grant themselves any access right they wish and,
987thus, effectively override any inherited access rights from the
988"`All-Projects`" or some other common parent project.
989
990What is needed is a mechanism to block a permission in a parent project so
991that even project owners cannot allow a blocked permission in their child
992project. Still, project owners should retain the possibility to manage all
993non-blocked rules as they wish. This gives best of both worlds:
994
995* Gerrit administrators can concentrate on enforcing site wide policies
996 and providing a meaningful set of default access permissions
997* Project owners can manage access rights of their projects without a danger
998 of violating a site wide policy
999
Edwin Kempin60ab8532013-03-27 14:33:46 +01001000[[block]]
Sasa Zivkovd589f462013-02-12 14:27:09 +01001001'BLOCK' access rule
1002~~~~~~~~~~~~~~~~~~~
1003
1004The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK' rule cannot
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001005be overridden in the inheriting project. Any 'ALLOW' rule, from a different
1006access section or from an inheriting project, which conflicts with an
1007inherited 'BLOCK' rule will not be honored. Searching for 'BLOCK' rules, in
Sasa Zivkovd589f462013-02-12 14:27:09 +01001008the chain of parent projects, ignores the Exclusive flag that is normally
1009applied to access sections.
1010
1011A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1012force or not. A blocking force push rule blocks only force pushes, but
1013allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1014
1015It is also possible to block label ranges. To block a group 'X' from voting
1016'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1017range intact we would define:
1018
1019====
1020 [access "refs/heads/*"]
1021 label-Code-Review = block -2..+2 group X
1022====
1023
1024The interpretation of the 'min..max' range in case of a blocking rule is: block
1025every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1026means that the range '-1..+1' is not affected by this block.
1027
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001028'BLOCK' and 'ALLOW' rules in the same access section
1029~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1030
1031When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1032the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1033
1034====
1035 [access "refs/heads/*"]
1036 push = block group X
1037 push = group Y
1038====
1039
1040In this case a user which is a member of the group 'Y' will still be allowed to
1041push to 'refs/heads/*' even if it is a member of the group 'X'.
1042
1043NOTE: An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
1044inside the same access section of the same project. An 'ALLOW' rule in a
1045different access section of the same project or in any access section in an
1046inheriting project cannot override a 'BLOCK' rule.
1047
Sasa Zivkovd589f462013-02-12 14:27:09 +01001048Examples
1049~~~~~~~~
1050
1051The following examples show some possible use cases for the 'BLOCK' rules.
1052
1053Make sure no one can update or delete a tag
1054^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1055
1056This requirement is quite common in a corporate deployment where
1057reproducibility of a build must be guaranteed. To achieve that we block 'push'
1058permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1059
1060====
1061 [access "refs/tags/*"]
1062 push = block group Anonymous Users
1063====
1064
1065By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1066everyone as everyone is a member of that group. Note that the permission to
1067create a tag is still necessary. Assuming that only <<category_owner,project
1068owners>> are allowed to create tags, we would extend the example above:
1069
1070====
1071 [access "refs/tags/*"]
1072 push = block group Anonymous Users
1073 create = group Project Owners
1074 pushTag = group Project Owners
1075====
Fredrik Luthander9c645362012-03-22 18:10:42 +01001076
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001077Let only a dedicated group vote in a special category
1078^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1079
1080Assume there is a more restrictive process for submitting changes in stable
1081release branches which is manifested as a new voting category
1082'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1083group can vote in this category and that even project owners cannot approve
1084this category. We have to block everyone except the 'Release Engineers' to vote
1085in this category and, of course, allow 'Release Engineers' to vote in that
1086category. In the "`All-Projects`" we define the following rules:
1087
1088====
1089 [access "refs/heads/stable*"]
1090 label-Release-Proces = block -1..+1 group Anonymous Users
1091 label-Release-Proces = -1..+1 group Release Engineers
1092====
1093
Fredrik Luthander71267062011-12-21 18:38:45 +01001094[[conversion_table]]
1095Conversion table from 2.1.x series to 2.2.x series
1096--------------------------------------------------
1097
1098[options="header"]
1099|=================================================================================
1100|Gerrit 2.1.x |Gerrit 2.2.x
Dave Borowitz01c1b1f2013-02-27 13:49:04 -08001101|Code review |link:config-labels.html#label_Code-Review[Label: Code-Review]
1102|Verify |link:config-labels.html#label_Verified[Label: Verify]
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001103|Forge Identity +1 |Forge <<category_forge_author,author>> identity
1104|Forge Identity +2 |Forge <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
1105|Forge Identity +3 |Forge <<category_forge_server,server>> & <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
1106|Owner |<<category_owner,Owner>>
1107|Push branch +1 |<<category_push_direct,Push>>
1108|Push branch +2 |<<category_create,Create reference>> & <<category_push_direct,Push>>
1109|Push branch +3 |<<category_push_direct,Push>> (with force) & <<category_create,Create reference>>
Fredrik Luthander71267062011-12-21 18:38:45 +01001110|Push tag +1 & Push Branch +2 |No support to limit to push signed tag
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001111|Push tag +2 & Push Branch +2 |<<category_push_annotated,Push annotated tag>>
1112|Push Branch +2 (refs/tags/*) |<<category_create,Create reference>> (refs/tags/...)
1113|Push Branch +3 (refs/tags/*) |<<category_push_direct,Push>> (with force on refs/tags/...)
1114|Read +1 |<<category_read,Read>>
1115|Read +2 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...)
Edwin Kempinaef5d6e2012-01-24 09:04:54 +01001116|Read +3 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...) & <<category_push_merge,Push Merge Commit>>
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001117|Submit |<<category_submit,Submit>>
Fredrik Luthander71267062011-12-21 18:38:45 +01001118|=================================================================================
1119
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +01001120
Fredrik Luthander71267062011-12-21 18:38:45 +01001121[NOTE]
1122In Gerrit 2.2.x, the way to set permissions for upload has changed entirely.
1123To upload a change for review is no longer a separate permission type,
1124instead you grant ordinary push permissions to the actual
1125recieving reference. In practice this means that you set push permissions
1126on `refs/for/refs/heads/<branch>` rather than permissions to upload changes
1127on `refs/heads/<branch>`.
1128
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001129
David Pursehouse8becc2a2013-04-23 18:51:04 +09001130[[global_capabilities]]
1131Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001132-------------------
1133
David Pursehouse8becc2a2013-04-23 18:51:04 +09001134The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001135the server can perform which usually affect the entire
1136server in some way. The administrators may delegate these
1137capabilities to trusted groups of users.
1138
1139Delegation of capabilities allows groups to be granted a subset of
1140administrative capabilities without being given complete
1141administrative control of the server. This makes it possible to
1142keep fewer users in the administrators group, even while spreading
1143much of the server administration burden out to more users.
1144
David Pursehouse8becc2a2013-04-23 18:51:04 +09001145Global capabilities are assigned to groups in the access rights settings
1146of the root project ("`All-Projects`").
1147
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001148Below you find a list of capabilities available:
1149
1150
Fredrik Luthander426885f2012-02-13 09:56:57 +01001151[[capability_administrateServer]]
1152Administrate Server
1153~~~~~~~~~~~~~~~~~~~
1154
1155This is in effect the owner and administrator role of the Gerrit
1156instance. Any members of a group granted this capability will be
1157able to grant any access right to any group. They will also have all
1158capabilities granted to them automatically.
1159
1160
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001161[[capability_createAccount]]
1162Create Account
1163~~~~~~~~~~~~~~
1164
Fredrik Luthander79d38152012-03-13 09:52:22 +01001165Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001166This capability allows the granted group members to create non-interactive
1167service accounts. These service accounts are generally used for automation
1168and made to be members of the
1169link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1170
1171
Fredrik Luthander79d38152012-03-13 09:52:22 +01001172[[capability_createGroup]]
1173Create Group
1174~~~~~~~~~~~~
1175
1176Allow group creation. Groups are used to grant users access to different
1177actions in projects. This capability allows the granted group members to
1178either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1179
1180
1181[[capability_createProject]]
1182Create Project
1183~~~~~~~~~~~~~~
1184
1185Allow project creation. This capability allows the granted group to
1186either link:cmd-create-project.html[create new git projects via ssh]
1187or via the web UI.
1188
Sasa Zivkov812f4892012-06-21 16:25:21 +02001189[[capability_emailReviewers]]
1190Email Reviewers
1191~~~~~~~~~~~~~~~
1192
1193Allow or deny sending email to change reviewers and watchers. This can be used
1194to deny build bots from emailing reviewers and people who watch the change.
1195Instead, only the authors of the change and those who starred it will be
1196emailed. The allow rules are evaluated before deny rules, however the default
1197is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001198
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001199[[capability_flushCaches]]
1200Flush Caches
1201~~~~~~~~~~~~
1202
Fredrik Luthander48603002012-03-21 18:17:17 +01001203Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001204group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1205
1206[NOTE]
1207This capability doesn't imply permissions to the show-caches command. For that
1208you need the <<capability_viewCaches,view caches capability>>.
1209
1210
Fredrik Luthander46843022012-03-13 16:11:02 +01001211[[capability_kill]]
1212Kill Task
1213~~~~~~~~~
1214
1215Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1216kill command ends tasks that currently occupy the Gerrit server, usually
1217a replication task or a user initiated task such as an upload-pack or
1218recieve-pack.
1219
1220
1221[[capability_priority]]
1222Priority
1223~~~~~~~~
1224
1225This capability allows users to use
1226link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1227link:access-control.html#non-interactive_users['Non-Interactive Users'].
1228It's a binary value in that granted users either have access to the thread
1229pool, or they don't.
1230
1231There are three modes for this capability and they're listed by rising
1232priority:
1233
1234No capability configured.::
1235The user isn't a member of a group with any priority capability granted. By
1236default the user is then in the 'INTERACTIVE' thread pool.
1237
1238'BATCH'::
1239If there's a thread pool configured for 'Non-Interactive Users' and a user is
1240granted the priority capability with the 'BATCH' mode selected, the user ends
1241up in the separate batch user thread pool. This is true unless the user is
1242also granted the below 'INTERACTIVE' option.
1243
1244'INTERACTIVE'::
1245If a user is granted the priority capability with the 'INTERACTIVE' option,
1246regardless if they also have the 'BATCH' option or not, they are in the
1247'INTERACTIVE' thread pool.
1248
1249
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001250[[capability_queryLimit]]
1251Query Limit
1252~~~~~~~~~~~
1253
1254Allow site administrators to configure the query limit for users to
1255be above the default hard-coded value of 500. Administrators can add
1256a global block to `All-Projects` with group(s) that
1257should have different limits:
1258
1259When applying a query limit to a user the largest value granted by
1260any of their groups is used.
1261
1262This limit applies not only to the link:cmd-query.html[`gerrit query`]
1263command, but also to the web UI results pagination size.
1264
1265
Chad Horohoeabd6d4e2013-02-14 16:27:34 -05001266[[capability_accessDatabase]]
1267Access Database
1268~~~~~~~~~~~~~~~
1269
1270Allow users to access the database using the `gsql` command.
1271
1272
Edwin Kempin619169b2012-02-09 15:47:52 +01001273[[capability_runGC]]
1274Run Garbage Collection
1275~~~~~~~~~~~~~~~~~~~~~~
1276
1277Allow users to run the Git garbage collection for the repositories of
1278all projects.
1279
1280
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001281[[capability_startReplication]]
1282Start Replication
1283~~~~~~~~~~~~~~~~~
1284
Shawn O. Pearce7d2cb042012-05-10 19:12:09 -07001285Allow access to execute `replication start` command, if the
1286replication plugin is installed on the server.
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001287
1288
Ed Bartoshd168b812013-04-13 20:15:58 +03001289[[capability_streamEvents]]
1290Stream Events
1291~~~~~~~~~~~~~
1292
1293Allow performing streaming of Gerrit events. This capability
1294allows the granted group to
1295link:cmd-stream-events.html[stream Gerrit events via ssh].
1296
1297
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001298[[capability_viewCaches]]
1299View Caches
1300~~~~~~~~~~~
1301
Fredrik Luthander48603002012-03-21 18:17:17 +01001302Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001303the granted group to
1304link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1305
1306
Fredrik Luthander48603002012-03-21 18:17:17 +01001307[[capability_viewConnections]]
1308View Connections
1309~~~~~~~~~~~~~~~~
1310
1311Allow querying for status of Gerrit's current client connections. This
1312capability allows the granted group to
1313link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1314
1315
1316[[capability_viewQueue]]
1317View Queue
1318~~~~~~~~~~
1319
1320Allow querying for status of Gerrit's internal task queue. This capability
1321allows the granted group to
1322link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1323
1324
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001325GERRIT
1326------
1327Part of link:index.html[Gerrit Code Review]