blob: 70d645d12a071720ac46f99632d0bdeab1fd2559 [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
26of any other access controls. In most installations only those
27users 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
96It is typical to assign `Code Review -1..+1` to this group,
97allowing 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
137
138Project Access Control Lists
139----------------------------
140
lincolnfa7bdd32010-04-22 14:23:05 -0300141A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700142project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300143through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800144
145Per-project access control lists are also supported.
146
147Users are permitted to use the maximum range granted to any of their
148groups in an approval category. For example, a user is a member of
149`Foo Leads`, and the following ACLs are granted on a project:
150
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100151[options="header"]
152|=================================================
153|Group |Reference Name |Category|Range
154|Anonymous Users |refs/heads/*|Code Review|-1..+1
155|Registered Users|refs/heads/*|Code Review|-1..+2
156|Foo Leads |refs/heads/*|Code Review|-2..0
157|=================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800158
159Then the effective range permitted to be used by the user is
160`-2..+2`, as the user is a member of all three groups (see above
161about the system groups) and the maximum range is chosen (so the
162lowest value granted to any group, and the highest value granted
163to any group).
164
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800165Reference-level access control is also possible.
166
167Permissions can be set on a single reference name to match one
168branch (e.g. `refs/heads/master`), or on a reference namespace
Edwin Kempina2bf0832011-09-08 14:23:30 +0200169(e.g. `refs/heads/*`) to match any branch starting with that
170prefix. So a permission with `refs/heads/*` will match
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800171`refs/heads/master` and `refs/heads/experimental`, etc.
172
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700173Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200174by prefixing the reference name with `^`. For example
175`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700176between 1 and 8 characters long. Within a regular expression `.`
177is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100178The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
179is used for evaluation of regular expression access control
180rules. See the library documentation for details on this
181particular regular expression flavor.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700182
183References can have the current user name automatically included,
184creating dynamic access controls that change to match the currently
185logged in user. For example to provide a personal sandbox space
Edwin Kempina2bf0832011-09-08 14:23:30 +0200186to all developers, `refs/heads/sandbox/${username}/*` allowing
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700187the user 'joe' to use 'refs/heads/sandbox/joe/foo'.
188
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800189When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700190the full set of access rights to determine if the user
191is allowed to perform a given action. For example, if a user is a
192member of `Foo Leads`, they are reviewing a change destined for
193the `refs/heads/qa` branch, and the following ACLs are granted
194on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800195
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100196[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100197|===============================================================
198|Group |Reference Name|Category |Range |Exclusive
199|Registered Users |refs/heads/* |Code Review| -1..+1 |
200|Foo Leads |refs/heads/* |Code Review| -2..+2 |
201|QA Leads |refs/heads/qa |Code Review| -2..+2 |
202|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800203
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700204Then the effective range permitted to be used by the user is
205`-2..+2`, as the user's membership of `Foo Leads` effectively grant
206them access to the entire reference space, thanks to the wildcard.
207
208Gerrit also supports exclusive reference-level access control.
209
210It is possible to configure Gerrit to grant an exclusive ref level
211access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100212an operation on a project/reference pair. This is done by ticking
213the exclusive flag when setting the permission for the
214`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700215
216For example, if a user who is a member of `Foo Leads` tries to
217review a change destined for branch `refs/heads/qa` in a project,
218and the following ACLs are granted:
219
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100220[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100221|==============================================================
222|Group |Reference Name|Category |Range |Exclusive
223|Registered Users|refs/heads/* |Code Review| -1..+1 |
224|Foo Leads |refs/heads/* |Code Review| -2..+2 |
225|QA Leads |refs/heads/qa |Code Review| -2..+2 |X
226|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700227
228Then this user will not have `Code Review` rights on that change,
229since there is an exclusive access right in place for the
230`refs/heads/qa` branch. This allows locking down access for a
231particular branch to a limited set of users, bypassing inherited
232rights and wildcards.
233
234In order to grant the ability to `Code Review` to the members of
235`Foo Leads`, in `refs/heads/qa` then the following access rights
236would be needed:
237
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100238[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100239|==============================================================
240|Group |Reference Name|Category |Range |Exclusive
241|Registered Users|refs/heads/* |Code Review| -1..+1 |
242|Foo Leads |refs/heads/* |Code Review| -2..+2 |
243|QA Leads |refs/heads/qa |Code Review| -2..+2 |X
244|Foo Leads |refs/heads/qa |Code Review| -2..+2 |
245|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700246
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800247OpenID Authentication
248~~~~~~~~~~~~~~~~~~~~~
249
250If the Gerrit instance is configured to use OpenID authentication,
251an account's effective group membership will be restricted to only
252the `Anonymous Users` and `Registered Users` groups, unless *all*
253of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700254in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800255
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800256All Projects
257~~~~~~~~~~~~
258
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700259Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800260is automatically inherited by every other project in the same
261Gerrit instance. These rights can be seen, but not modified,
262in any other project's `Access` administration tab.
263
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100264Only members of the groups with the `Administrate Server` capability
265may edit the access control list for `All-Projects`. By default this
266capability is given to the group `Administrators`, but can be given
267to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700268
269Ownership of this project cannot be delegated to another group.
270This restriction is by design. Granting ownership to another
271group gives nearly the same level of access as membership in
272`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100273permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700274
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800275Per-Project
276~~~~~~~~~~~
277
Fredrik Luthanderda867882011-12-21 18:28:40 +0100278The per-project ACL is evaluated before the global `All-Projects` ACL,
279permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100280behavior is generally only useful on the `Read` category when
281granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800282
283
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100284[[access_category]]
285Access Categories
286-----------------
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800287
288Gerrit comes pre-configured with several default categories that
289can be granted to groups within projects, enabling functionality
290for that group's members.
291
Fredrik Luthander71267062011-12-21 18:38:45 +0100292With the release of the Gerrit 2.2.x series, the web GUI for ACL
293configuration was rewritten from scratch. Use this
294<<conversion_table,table>> to better understand the access rights
295conversions from the Gerrit 2.1.x to the Gerrit 2.2.x series.
296
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800297
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100298[[category_label-Verified]]
299Label: Verified
300~~~~~~~~~~~~~~~
301
302The verified category is one of two default categories that is
303configured upon the creation of a Gerrit instance. It may have
304any meaning the project desires. It was originally invented by
305the Android Open Source Project to mean
306'compiles, passes basic unit tests'.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800307
308The range of values is:
309
310* -1 Fails
311+
312Tried to compile, but got a compile error, or tried to run tests,
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100313but one or more tests did not pass. This value is valid
314across all patch sets in the same change, i.e. the reviewer must
315actively change his/her review to something else before the change
316is submittable.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800317+
318*Any -1 blocks submit.*
319
320* 0 No score
321+
322Didn't try to perform the verification tasks.
323
324* +1 Verified
325+
326Compiled (and ran tests) successfully.
327+
328*Any +1 enables submit.*
329
Fredrik Luthander1898adb2011-11-10 00:15:09 +0100330For a change to be submittable, the change must have a `+1 Verified`
331in this category from at least one authorized user, and no `-1 Fails`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800332from an authorized user. Thus, `-1 Fails` can block a submit,
333while `+1 Verified` enables a submit.
334
335If a Gerrit installation does not wish to use this category in any
336project, it can be deleted from the database:
337
338====
339 DELETE FROM approval_categories WHERE category_id = 'VRIF';
340 DELETE FROM approval_category_values WHERE category_id = 'VRIF';
341====
342
343If a Gerrit installation wants to modify the description text
344associated with these category values, the text can be updated
Edwin Kempina2bf0832011-09-08 14:23:30 +0200345in the `name` column of the `category_id = 'VRIF'` rows in the
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800346`approval_category_values` table.
347
348Additional values could also be added to this category, to allow it
349to behave more like `Code Review` (below). Insert -2 and +2 value
350rows into the `approval_category_values` with `category_id` set to
351`VRIF` to get the same behavior.
352
353[NOTE]
354A restart is required after making database changes.
355See <<restart_changes,below>>.
356
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100357[[category_label-Code-Review]]
358Label: Code Review
359~~~~~~~~~~~~~~~~~~
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800360
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100361The code review category is the second of two default categories that
362is configured upon the creation of a Gerrit instance. It may have
363any meaning the project desires. It was originally invented by the
364Android Open Source Project to mean 'I read the code and it seems
365reasonably correct'.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800366
367The range of values is:
368
369* -2 Do not submit
370+
371The code is so horribly incorrect/buggy/broken that it must not be
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100372submitted to this project, or to this branch. This value is valid
373across all patch sets in the same change, i.e. the reviewer must
374actively change his/her review to something else before the change
375is submittable.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800376+
377*Any -2 blocks submit.*
378
379* -1 I would prefer that you didn't submit this
380+
381The code doesn't look right, or could be done differently, but
382the reviewer is willing to live with it as-is if another reviewer
383accepts it, perhaps because it is better than what is currently in
384the project. Often this is also used by contributors who don't like
385the change, but also aren't responsible for the project long-term
386and thus don't have final say on change submission.
387+
388Does not block submit.
389
390* 0 No score
391+
392Didn't try to perform the code review task, or glanced over it but
393don't have an informed opinion yet.
394
395* +1 Looks good to me, but someone else must approve
396+
397The code looks right to this reviewer, but the reviewer doesn't
398have access to the `+2` value for this category. Often this is
399used by contributors to a project who were able to review the change
400and like what it is doing, but don't have final approval over what
401gets submitted.
402
403* +2 Looks good to me, approved
404+
405Basically the same as `+1`, but for those who have final say over
406how the project will develop.
407+
408*Any +2 enables submit.*
409
Fredrik Luthanderb8686382011-12-08 16:56:03 +0100410For a change to be submittable, the latest patch set must have a
411`+2 Looks good to me, approved` in this category from at least one
412authorized user, and no `-2 Do not submit` from an authorized user.
413Thus `-2` on any patch set can block a submit, while `+2` on the
414latest patch set can enable it.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800415
416If a Gerrit installation does not wish to use this category in any
417project, it can be deleted from the database:
418
419====
420 DELETE FROM approval_categories WHERE category_id = 'CRVW';
421 DELETE FROM approval_category_values WHERE category_id = 'CRVW';
422====
423
424If a Gerrit installation wants to modify the description text
425associated with these category values, the text can be updated
Edwin Kempina2bf0832011-09-08 14:23:30 +0200426in the `name` column of the `category_id = 'CRVW'` rows in the
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800427`approval_category_values` table.
428
429Additional values could be inserted into `approval_category_values`
430to further extend the negative and positive range, but there is
431likely little value in doing so as this only expands the middle
432region. This category is a `MaxWithBlock` type, which means that
433the lowest negative value if present blocks a submit, while the
434highest positive value is required to enable submit.
435
Shawn O. Pearce2d524492010-02-22 07:28:14 -0800436[[function_MaxNoBlock]]
Shane Mc Cormack66376d02010-01-29 19:12:58 +0000437There is also a `MaxNoBlock` category which still requires the
438highest positive value to submit, but the lowest negative value will
439not block the change, and does not carry over between patch sets.
440This level is mostly useful for automated code-reviews that may
441have false-negatives that shouldn't block the change.
442
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800443[NOTE]
444A restart is required after making database changes.
445See <<restart_changes,below>>.
446
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100447[[category_create]]
448Create reference
449~~~~~~~~~~~~~~~~
450
451The create reference category controls whether it is possible to
452create new references, branches or tags. This implies that the
453reference must not already exist, it's not a destructive permission
454in that you can't overwrite or remove any previosuly existing
455references (and also discard any commits in the process).
456
457It's probably most common to either permit the creation of a single
458branch in many gits (by granting permission on a parent project), or
459to grant this permission to a name pattern of branches.
460
461This permission is often given in conjunction with regular push
462branch permissions, allowing the holder of both to create new branches
463as well as bypass review for new commits on that branch.
464
465To push lightweight (non annotated) tags, grant
466`Create Reference` for reference name `refs/tags/*`, as lightweight
467tags are implemented just like branches in Git.
468
469For example, to grant the possibility to create new branches under the
470namespace `foo`, you have to grant this permission on
471`refs/heads/foo/*` for the group that should have it.
472Finally, if you plan to grant each user a personal namespace in
473where they are free to create as many branches as they wish, you
474should grant the create reference permission so it's possible
475to create new branches. This is done by using the special
476`${username}` keyword in the reference pattern, e.g.
477`refs/heads/sandbox/${username}/*`. If you do, it's also recommended
478you grant the users the push force permission to be able to clean up
479stale branches.
480
481
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100482[[category_forge_author]]
483Forge Author
484~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100485
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.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100489This permission allows users to bypass parts of that validation, which
490may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100491
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100492Permits the use of an unverified author line in commit objects.
493This can be useful when applying patches received by email from
4943rd parties, when cherry-picking changes written by others across
495branches, or when amending someone else's commit to fix up a minor
496problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100497
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100498By default this is granted to `Registered Users` in all projects,
499but a site administrator may disable it if verified authorship
500is required.
501
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100502
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100503[[category_forge_committer]]
504Forge Committer
505~~~~~~~~~~~~~~~
506
507Normally Gerrit requires the author and the committer identity
508lines in a Git commit object (or tagger line in an annotated tag) to
509match one of the registered email addresses of the uploading user.
510This permission allows users to bypass parts of that validation, which
511may be necessary when mirroring changes from an upstream project.
512
513Allows the use of an unverified committer line in commit objects, or an
514unverified tagger line in annotated tag objects. Typically this is only
515required when mirroring commits from an upstream project repository.
516
517
518[[category_forge_server]]
519Forge Server
520~~~~~~~~~~~~
521
522Normally Gerrit requires the author and the committer identity
523lines in a Git commit object (or tagger line in an annotated tag) to
524match one of the registered email addresses of the uploading user.
525This permission allows users to bypass parts of that validation, which
526may be necessary when mirroring changes from an upstream project.
527
528Allows the use of the server's own name and email on the committer
529line of a new commit object. This should only be necessary when force
530pushing a commit history which has been rewritten by 'git filter-branch'
531and that contains merge commits previously created by this Gerrit Code
532Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100533
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100534
535[[category_owner]]
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100536Owner
537~~~~~
538
539The `Owner` category controls which groups can modify the project's
540configuration. Users who are members of an owner group can:
541
542* Change the project description
543* Create/delete a branch through the web UI (not SSH)
544* Grant/revoke any access rights, including `Owner`
545
546Note that project owners implicitly have branch creation or deletion
547through the web UI, but not through SSH. To get SSH branch access
548project owners must grant an access right to a group they are a
549member of, just like for any other user.
550
551Ownership over a particular branch subspace may be delegated by
552entering a branch pattern. To delegate control over all branches
553that begin with `qa/` to the QA group, add `Owner` category
554for reference `refs/heads/qa/\*`. Members of the QA group can
555further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100556`refs/heads/qa/`. See <<project_owners,project owners>> to find
557out more about this role.
558
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100559
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100560[[category_push]]
561Push
562~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100563
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100564This category controls how users are allowed to upload new commits
565to projects in Gerrit. It can either give permission to push
566directly into a branch, bypassing any code review process
567that would otherwise be used. Or it may give permission to upload
568new changes for code review, this depends on which namespace the
569permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100570
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100571
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100572[[category_push_direct]]
573Direct Push
574^^^^^^^^^^^
575
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100576Any existing branch can be fast-forwarded to a new commit.
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100577Creation of new branches is controlled by the
578link:access-control.html#category_create['Create Reference']
579category. Deletion of existing branches is rejected. This is the
580safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100581
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100582* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100583+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100584Allows an existing branch to be deleted. Since a force push is
585effectively a delete immediately followed by a create, but performed
586atomically on the server and logged, this option also permits forced
587push updates to branches. Enabling this option allows existing commits
588to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100589
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100590The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100591take advantage of Gerrit's access control features and do not need
592its code review functionality. Projects that need to require code
593reviews should not grant this category.
594
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100595
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100596[[category_push_review]]
597Upload To Code Review
598^^^^^^^^^^^^^^^^^^^^^
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100599
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100600The `Push` access right granted on the namespace
601`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
602commit to the project's `refs/for/BRANCH` namespace, creating a new
603change for code review.
604
605A user must be able to clone or fetch the project in order to create
606a new commit on their local system, so in practice they must also
607have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100608
609For an open source, public Gerrit installation, it is common to
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100610grant `Read` and `Push` for `refs/for/refs/heads/*`
611to `Registered Users` in the `All-Projects` ACL. For more
612private installations, its common to simply grant `Read` and
613`Push` for `refs/for/refs/heads/*` to all users of a project.
614
615* Force option
616+
617The force option has no function when granted to a branch in the
618`refs/for/refs/heads/*` namespace.
619
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100620
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100621[[category_push_merge]]
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100622Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100623~~~~~~~~~~~~~~~~~~~~
624
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100625The `Push Merge Commit` permits the user to upload merge commits.
626It's an addon to the <<category_push,Push>> access right, and so it
627won't be sufficient with only `Push Merge Commit` granted for a push
628to happen. Some projects wish to restrict merges to being created by
629Gerrit. By granting `Push` without `Push Merge Commit`, the only
630merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100631
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100632
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100633[[category_push_annotated]]
634Push Annotated Tag
635~~~~~~~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100636
637This category permits users to push an annotated tag object over
638SSH into the project's repository. Typically this would be done
639with a command line such as:
640
641====
642 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
643====
644
645Tags must be annotated (created with `git tag -a` or `git tag -s`),
646should exist in the `refs/tags/` namespace, and should be new.
647
648This category is intended to be used to publish tags when a project
649reaches a stable release point worth remembering in history.
650
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100651It allows for a new annotated (unsigned) tag to be created. The
652tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100653
654To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100655as tags mirrored from an upstream project), `Forge Committer Identity`
656must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100657
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100658To push lightweight (non annotated) tags, grant
659<<category_create,`Create Reference`>> for reference name
660`refs/tags/*`, as lightweight tags are implemented just like
661branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100662
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100663To delete or overwrite an existing tag, grant `Push` with the force
664option enabled for reference name `refs/tags/*`, as deleting a tag
665requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100666
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100667
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100668[[category_read]]
669Read
670~~~~
671
672The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100673changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100674A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100675changes, or any of its data.
676
677This category has a special behavior, where the per-project ACL is
678evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100679ACL has granted `Read` with 'DENY', and does not otherwise grant
680`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100681is ignored. This behavior is useful to hide a handful of projects
682on an otherwise public server.
683
684For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100685`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
686casual browsing of any project's changes, as well as fetching any
687project's repository over SSH or HTTP. New projects can be
688temporarily hidden from public view by granting `Read` with 'DENY'
689to `Anonymous Users` and granting `Read` to the project owner's
690group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100691
692For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100693source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100694typical, enabling read access only to those users who have been
695able to authenticate through the HTTP access controls. This may
696be suitable in a corporate deployment if the HTTP access control
697is already restricted to the correct set of users.
698
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100699
700[[category_submit]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800701Submit
702~~~~~~
703
704This category permits users to push the `Submit Patch Set n` button
705on the web UI.
706
707Submitting a change causes it to be merged into the destination
708branch as soon as possible, making it a permanent part of the
709project's history.
710
711In order to submit, all approval categories (such as `Verified` and
712`Code Review`, above) must enable submit, and also must not block it.
713See above for details on each category.
714
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100715
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800716[[category_makeoneup]]
717Your Category Here
718~~~~~~~~~~~~~~~~~~
719
720Gerrit administrators can also make up their own categories.
721
Fredrik Luthander54abc352012-01-20 16:18:41 +0100722See above for descriptions of how <<category_verified,`Verified`>>
723and <<category_review,`Code Review`>> work, and insert your own
724category with `function_name = 'MaxWithBlock'` to get the same
725behavior over your own range of values, in any category you desire.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800726
727Ensure `category_id` is unique within your `approval_categories`
728table. The default values `VRIF` and `CVRF` used for the categories
729described above are simply that, defaults, and have no special
Fredrik Luthander54abc352012-01-20 16:18:41 +0100730meaning to Gerrit.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800731
732The `position` column of `approval_categories` controls which column
733of the 'Approvals' table the category appears in, providing some
734layout control to the administrator.
735
736All `MaxWithBlock` categories must have at least one positive value
737in the `approval_category_values` table, or else submit will never
738be enabled.
739
740To permit blocking submits, ensure a negative value is defined for
741your new category. If you do not wish to have a blocking submit
742level for your category, do not define values less than 0.
743
744Keep in mind that category definitions are currently global to
745the entire Gerrit instance, and affect all projects hosted on it.
746Any change to a category definition affects everyone.
747
748For example, to define a new 3-valued category that behaves exactly
749like `Verified`, but has different names/labels:
750
751====
752 INSERT INTO approval_categories
753 (name
754 ,position
755 ,function_name
756 ,category_id)
757 VALUES
758 ('Copyright Check'
759 ,3
Edwin Kempina164c2d2012-01-10 13:59:46 +0100760 ,'MaxWithBlock'
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800761 ,'copy');
762
763 INSERT INTO approval_category_values
764 (category_id,value,name)
765 VALUES
766 ('copy', -1, 'Do not have copyright');
767
768 INSERT INTO approval_category_values
769 (category_id,value,name)
770 VALUES
771 ('copy', 0, 'No score');
772
773 INSERT INTO approval_category_values
774 (category_id,value,name)
775 VALUES
776 ('copy', 1, 'Copyright clear');
777====
778
779The new column will appear at the end of the table (in position 3),
780and `-1 Do not have copyright` will block submit, while `+1 Copyright
781clear` is required to enable submit.
782
Fredrik Luthander71267062011-12-21 18:38:45 +0100783
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100784Examples of typical roles in a project
785--------------------------------------
786
787Below follows a set of typical roles on a server and which access
788rights these roles typically should be granted. You may see them as
789general guide lines for a typical way to set up your project on a
790brand new Gerrit instance.
791
792[[examples_contributor]]
793Contributor
794~~~~~~~~~~~
795
796This is the typical user on a public server. They are able to read
797your project and upload new changes to it. They are able to give
798feedback on other changes as well, but are unable to block or approve
799any changes.
800
801Suggested access rights to grant:
802
803* <<category_read,`Read`>> on 'refs/heads/\*' and 'refs/tags/*'
804* <<category_push,`Push`>> to 'refs/for/refs/heads/\*' and 'refs/changes/*'
805* <<category_label-Code-Review,`Code review`>> with range '-1' to '+1'
806
807
Fredrik Luthander71267062011-12-21 18:38:45 +0100808[[conversion_table]]
809Conversion table from 2.1.x series to 2.2.x series
810--------------------------------------------------
811
812[options="header"]
813|=================================================================================
814|Gerrit 2.1.x |Gerrit 2.2.x
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +0100815|Code review |<<category_label-Code-Review,Label: Code review>>
816|Verify |<<category_label-Verified,Label: Verify>>
817|Forge Identity +1 |Forge <<category_forge_author,author>> identity
818|Forge Identity +2 |Forge <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
819|Forge Identity +3 |Forge <<category_forge_server,server>> & <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
820|Owner |<<category_owner,Owner>>
821|Push branch +1 |<<category_push_direct,Push>>
822|Push branch +2 |<<category_create,Create reference>> & <<category_push_direct,Push>>
823|Push branch +3 |<<category_push_direct,Push>> (with force) & <<category_create,Create reference>>
Fredrik Luthander71267062011-12-21 18:38:45 +0100824|Push tag +1 & Push Branch +2 |No support to limit to push signed tag
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +0100825|Push tag +2 & Push Branch +2 |<<category_push_annotated,Push annotated tag>>
826|Push Branch +2 (refs/tags/*) |<<category_create,Create reference>> (refs/tags/...)
827|Push Branch +3 (refs/tags/*) |<<category_push_direct,Push>> (with force on refs/tags/...)
828|Read +1 |<<category_read,Read>>
829|Read +2 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...)
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100830|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 +0100831|Submit |<<category_submit,Submit>>
Fredrik Luthander71267062011-12-21 18:38:45 +0100832|=================================================================================
833
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +0100834
Fredrik Luthander71267062011-12-21 18:38:45 +0100835[NOTE]
836In Gerrit 2.2.x, the way to set permissions for upload has changed entirely.
837To upload a change for review is no longer a separate permission type,
838instead you grant ordinary push permissions to the actual
839recieving reference. In practice this means that you set push permissions
840on `refs/for/refs/heads/<branch>` rather than permissions to upload changes
841on `refs/heads/<branch>`.
842
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +0100843
844System capabilities
845-------------------
846
847The system capabilities control actions that the administrators of
848the server can perform which usually affect the entire
849server in some way. The administrators may delegate these
850capabilities to trusted groups of users.
851
852Delegation of capabilities allows groups to be granted a subset of
853administrative capabilities without being given complete
854administrative control of the server. This makes it possible to
855keep fewer users in the administrators group, even while spreading
856much of the server administration burden out to more users.
857
858Below you find a list of capabilities available:
859
860
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +0100861* View Connections
862
863* View Queue
864
865
Fredrik Luthander426885f2012-02-13 09:56:57 +0100866[[capability_administrateServer]]
867Administrate Server
868~~~~~~~~~~~~~~~~~~~
869
870This is in effect the owner and administrator role of the Gerrit
871instance. Any members of a group granted this capability will be
872able to grant any access right to any group. They will also have all
873capabilities granted to them automatically.
874
875
Fredrik Luthanderb02afca2012-02-13 09:59:48 +0100876[[capability_createAccount]]
877Create Account
878~~~~~~~~~~~~~~
879
Fredrik Luthander79d38152012-03-13 09:52:22 +0100880Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +0100881This capability allows the granted group members to create non-interactive
882service accounts. These service accounts are generally used for automation
883and made to be members of the
884link:access-control.html#non-interactive_users['Non-Interactive users'] group.
885
886
Fredrik Luthander79d38152012-03-13 09:52:22 +0100887[[capability_createGroup]]
888Create Group
889~~~~~~~~~~~~
890
891Allow group creation. Groups are used to grant users access to different
892actions in projects. This capability allows the granted group members to
893either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
894
895
896[[capability_createProject]]
897Create Project
898~~~~~~~~~~~~~~
899
900Allow project creation. This capability allows the granted group to
901either link:cmd-create-project.html[create new git projects via ssh]
902or via the web UI.
903
904
Fredrik Luthander74ad0d02012-03-13 13:06:30 +0100905[[capability_flushCaches]]
906Flush Caches
907~~~~~~~~~~~~
908
909Allow the flushing of Gerrits caches. This capability allows the granted
910group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
911
912[NOTE]
913This capability doesn't imply permissions to the show-caches command. For that
914you need the <<capability_viewCaches,view caches capability>>.
915
916
Fredrik Luthander46843022012-03-13 16:11:02 +0100917[[capability_kill]]
918Kill Task
919~~~~~~~~~
920
921Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
922kill command ends tasks that currently occupy the Gerrit server, usually
923a replication task or a user initiated task such as an upload-pack or
924recieve-pack.
925
926
927[[capability_priority]]
928Priority
929~~~~~~~~
930
931This capability allows users to use
932link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
933link:access-control.html#non-interactive_users['Non-Interactive Users'].
934It's a binary value in that granted users either have access to the thread
935pool, or they don't.
936
937There are three modes for this capability and they're listed by rising
938priority:
939
940No capability configured.::
941The user isn't a member of a group with any priority capability granted. By
942default the user is then in the 'INTERACTIVE' thread pool.
943
944'BATCH'::
945If there's a thread pool configured for 'Non-Interactive Users' and a user is
946granted the priority capability with the 'BATCH' mode selected, the user ends
947up in the separate batch user thread pool. This is true unless the user is
948also granted the below 'INTERACTIVE' option.
949
950'INTERACTIVE'::
951If a user is granted the priority capability with the 'INTERACTIVE' option,
952regardless if they also have the 'BATCH' option or not, they are in the
953'INTERACTIVE' thread pool.
954
955
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +0100956[[capability_queryLimit]]
957Query Limit
958~~~~~~~~~~~
959
960Allow site administrators to configure the query limit for users to
961be above the default hard-coded value of 500. Administrators can add
962a global block to `All-Projects` with group(s) that
963should have different limits:
964
965When applying a query limit to a user the largest value granted by
966any of their groups is used.
967
968This limit applies not only to the link:cmd-query.html[`gerrit query`]
969command, but also to the web UI results pagination size.
970
971
Fredrik Luthander9c7da662012-03-13 17:49:27 +0100972[[capability_startReplication]]
973Start Replication
974~~~~~~~~~~~~~~~~~
975
976Allow access to execute link:cmd-replicate.html[the `gerrit replicate` command].
977
978
979[[capability_viewCaches]]
980View Caches
981~~~~~~~~~~~
982
983Allow querying for status of Gerrits internal caches. This capability allows
984the granted group to
985link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
986
987
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800988[[restart_changes]]
989[NOTE]
990Restart the Gerrit web application and reload all browsers after
Shawn O. Pearcec40ea192009-08-21 18:56:21 -0700991making any database changes to approval categories. Browsers are
992sent the list of known categories when they first visit the site,
993and don't notice changes until the page is closed and opened again,
994or is reloaded.
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700995
996GERRIT
997------
998Part of link:index.html[Gerrit Code Review]