blob: 70c58a252b96567774c6d9b2b42467f42682a4c4 [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
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08004Access 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 Luthander0907ba02011-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 Luthander5d976a02012-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 Luthander0907ba02011-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 Luthander0bb123d2011-12-29 11:36:48 +010076<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander0907ba02011-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 Luthander0bb123d2011-12-29 11:36:48 +010079<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander0907ba02011-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 Luthander2b3cd552012-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 Luthander5d976a02012-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 Luthander0907ba02011-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 Kempincdb0e002011-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 Kempincdb0e002011-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 Kempincdb0e002011-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 Luthander2b3cd552012-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 Luthander2b3cd552012-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 Luthander2b3cd552012-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 Luthander2b3cd552012-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 Luthanderc48f9e12011-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 Luthanderc48f9e12011-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 Luthander92222d42011-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 Luthander5d976a02012-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 Luthander10cd22a2011-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 Luthanderb1785b82011-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 Luthander10cd22a2011-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 Luthander10cd22a2011-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 Luthander10cd22a2011-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 Kempincdb0e002011-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 Luthandera3f73aa2011-12-08 16:56:03 +0100357[[category_label-Code-Review]]
358Label: Code Review
359~~~~~~~~~~~~~~~~~~
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800360
Fredrik Luthandera3f73aa2011-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 Luthandera3f73aa2011-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 Luthandera3f73aa2011-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 Kempincdb0e002011-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 Luthander5aa7b592011-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 Luthanderb295eea2011-12-27 13:40:43 +0100482[[category_forge_author]]
483Forge Author
484~~~~~~~~~~~~
Fredrik Luthanderfa2e3682011-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 Luthanderb295eea2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100491
Fredrik Luthanderfa2e3682011-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 Luthanderb295eea2011-12-27 13:40:43 +0100497
Fredrik Luthanderfa2e3682011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100502
Fredrik Luthanderb295eea2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100533
Fredrik Luthander0bb123d2011-12-29 11:36:48 +0100534
535[[category_owner]]
Fredrik Luthanderfa2e3682011-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
Edwin Kempin9ad27612011-11-21 10:59:25 +0100554for reference `refs/heads/qa/*`. Members of the QA group can
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100555further refine access, but only for references that begin with
Fredrik Luthander0907ba02011-11-07 17:04:01 +0100556`refs/heads/qa/`. See <<project_owners,project owners>> to find
557out more about this role.
558
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100559
Fredrik Luthander0bb123d2011-12-29 11:36:48 +0100560[[category_push]]
561Push
562~~~~
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100563
Fredrik Luthander0bb123d2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100570
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100571
Fredrik Luthander0bb123d2011-12-29 11:36:48 +0100572[[category_push_direct]]
573Direct Push
574^^^^^^^^^^^
575
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100576Any existing branch can be fast-forwarded to a new commit.
Fredrik Luthander0bb123d2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100581
Fredrik Luthander0bb123d2011-12-29 11:36:48 +0100582* Force option
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100583+
Fredrik Luthander0bb123d2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100589
Fredrik Luthander0bb123d2011-12-29 11:36:48 +0100590The push category is primarily useful for projects that only want to
Fredrik Luthanderfa2e3682011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100595
Fredrik Luthander0bb123d2011-12-29 11:36:48 +0100596[[category_push_review]]
597Upload To Code Review
598^^^^^^^^^^^^^^^^^^^^^
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100599
Fredrik Luthander0bb123d2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100608
609For an open source, public Gerrit installation, it is common to
Fredrik Luthander0bb123d2011-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 Luthanderfa2e3682011-11-03 08:52:56 +0100620
Fredrik Luthander51680572012-01-18 11:17:00 +0100621[[category_push_merge]]
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100622Push Merge Commits
Fredrik Luthander51680572012-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 Luthander51680572012-01-18 11:17:00 +0100631
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100632
Fredrik Luthander5b75c002012-01-20 07:29:43 +0100633[[category_push_annotated]]
634Push Annotated Tag
635~~~~~~~~~~~~~~~~~~
Fredrik Luthanderfa2e3682011-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 Luthander5b75c002012-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 Luthanderfa2e3682011-11-03 08:52:56 +0100653
654To push tags created by users other than the current user (such
Fredrik Luthander5b75c002012-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 Luthanderfa2e3682011-11-03 08:52:56 +0100657
Fredrik Luthander5b75c002012-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 Luthanderfa2e3682011-11-03 08:52:56 +0100662
Fredrik Luthander5b75c002012-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 Luthanderfa2e3682011-11-03 08:52:56 +0100666
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100667
Fredrik Luthander5d976a02012-01-20 13:06:06 +0100668[[category_read]]
669Read
670~~~~
671
672The `Read` category controls visibility to the project's
Fredrik Luthanderfa2e3682011-11-03 08:52:56 +0100673changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5d976a02012-01-20 13:06:06 +0100674A user must have this access granted in order to see a project, its
Fredrik Luthanderfa2e3682011-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 Luthander5d976a02012-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 Luthanderfa2e3682011-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 Luthander5d976a02012-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 Luthanderfa2e3682011-11-03 08:52:56 +0100691
692For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5d976a02012-01-20 13:06:06 +0100693source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderfa2e3682011-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 Luthander5d976a02012-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
715[[category_makeoneup]]
716Your Category Here
717~~~~~~~~~~~~~~~~~~
718
719Gerrit administrators can also make up their own categories.
720
Fredrik Luthander2b3cd552012-01-20 16:18:41 +0100721See above for descriptions of how <<category_verified,`Verified`>>
722and <<category_review,`Code Review`>> work, and insert your own
723category with `function_name = 'MaxWithBlock'` to get the same
724behavior over your own range of values, in any category you desire.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800725
726Ensure `category_id` is unique within your `approval_categories`
727table. The default values `VRIF` and `CVRF` used for the categories
728described above are simply that, defaults, and have no special
Fredrik Luthander2b3cd552012-01-20 16:18:41 +0100729meaning to Gerrit.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800730
731The `position` column of `approval_categories` controls which column
732of the 'Approvals' table the category appears in, providing some
733layout control to the administrator.
734
735All `MaxWithBlock` categories must have at least one positive value
736in the `approval_category_values` table, or else submit will never
737be enabled.
738
739To permit blocking submits, ensure a negative value is defined for
740your new category. If you do not wish to have a blocking submit
741level for your category, do not define values less than 0.
742
743Keep in mind that category definitions are currently global to
744the entire Gerrit instance, and affect all projects hosted on it.
745Any change to a category definition affects everyone.
746
747For example, to define a new 3-valued category that behaves exactly
748like `Verified`, but has different names/labels:
749
750====
751 INSERT INTO approval_categories
752 (name
753 ,position
754 ,function_name
755 ,category_id)
756 VALUES
757 ('Copyright Check'
758 ,3
Edwin Kempin6cc5ee02012-01-10 13:59:46 +0100759 ,'MaxWithBlock'
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800760 ,'copy');
761
762 INSERT INTO approval_category_values
763 (category_id,value,name)
764 VALUES
765 ('copy', -1, 'Do not have copyright');
766
767 INSERT INTO approval_category_values
768 (category_id,value,name)
769 VALUES
770 ('copy', 0, 'No score');
771
772 INSERT INTO approval_category_values
773 (category_id,value,name)
774 VALUES
775 ('copy', 1, 'Copyright clear');
776====
777
778The new column will appear at the end of the table (in position 3),
779and `-1 Do not have copyright` will block submit, while `+1 Copyright
780clear` is required to enable submit.
781
Fredrik Luthanderb1785b82011-12-21 18:38:45 +0100782
783[[conversion_table]]
784Conversion table from 2.1.x series to 2.2.x series
785--------------------------------------------------
786
787[options="header"]
788|=================================================================================
789|Gerrit 2.1.x |Gerrit 2.2.x
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +0100790|Code review |<<category_label-Code-Review,Label: Code review>>
791|Verify |<<category_label-Verified,Label: Verify>>
792|Forge Identity +1 |Forge <<category_forge_author,author>> identity
793|Forge Identity +2 |Forge <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
794|Forge Identity +3 |Forge <<category_forge_server,server>> & <<category_forge_committer,committer>> & <<category_forge_author,author>> identity
795|Owner |<<category_owner,Owner>>
796|Push branch +1 |<<category_push_direct,Push>>
797|Push branch +2 |<<category_create,Create reference>> & <<category_push_direct,Push>>
798|Push branch +3 |<<category_push_direct,Push>> (with force) & <<category_create,Create reference>>
Fredrik Luthanderb1785b82011-12-21 18:38:45 +0100799|Push tag +1 & Push Branch +2 |No support to limit to push signed tag
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +0100800|Push tag +2 & Push Branch +2 |<<category_push_annotated,Push annotated tag>>
801|Push Branch +2 (refs/tags/*) |<<category_create,Create reference>> (refs/tags/...)
802|Push Branch +3 (refs/tags/*) |<<category_push_direct,Push>> (with force on refs/tags/...)
803|Read +1 |<<category_read,Read>>
804|Read +2 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...)
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100805|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 +0100806|Submit |<<category_submit,Submit>>
Fredrik Luthanderb1785b82011-12-21 18:38:45 +0100807|=================================================================================
808
Fredrik Luthanderb7bd7e42012-01-23 16:01:37 +0100809
Fredrik Luthanderb1785b82011-12-21 18:38:45 +0100810[NOTE]
811In Gerrit 2.2.x, the way to set permissions for upload has changed entirely.
812To upload a change for review is no longer a separate permission type,
813instead you grant ordinary push permissions to the actual
814recieving reference. In practice this means that you set push permissions
815on `refs/for/refs/heads/<branch>` rather than permissions to upload changes
816on `refs/heads/<branch>`.
817
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800818[[restart_changes]]
819[NOTE]
820Restart the Gerrit web application and reload all browsers after
Shawn O. Pearcec40ea192009-08-21 18:56:21 -0700821making any database changes to approval categories. Browsers are
822sent the list of known categories when they first visit the site,
823and don't notice changes until the page is closed and opened again,
824or is reloaded.
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700825
826GERRIT
827------
828Part of link:index.html[Gerrit Code Review]