blob: e8d5c15dea214a43401dfb66737f1aae11722898 [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
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020018
Edwin Kempin913eab12011-05-06 08:18:24 +020019[[administrators]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080020Administrators
21~~~~~~~~~~~~~~
22
23This is the Gerrit "root" identity.
24
25Users in the 'Administrators' group can perform any action under
26the Admin menu, to any group or project, without further validation
David Pursehouse221d4f62012-06-08 17:38:08 +090027or any other access controls. In most installations only those
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080028users who have direct filesystem and database access would be
29placed into this group.
30
31Membership in the 'Administrators' group does not imply any other
32access rights. Administrators do not automatically get code review
33approval or submit rights in projects. This is a feature designed
Nico Sallembienee6eaf02010-02-01 13:24:49 -080034to permit administrative users to otherwise access Gerrit as any
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080035other normal user would, without needing two different accounts.
36
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020037
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010038[[anonymous_users]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080039Anonymous Users
40~~~~~~~~~~~~~~~
41
42All users are automatically a member of this group. Users who are
43not signed in are a member of only this group, and no others.
44
45Any access rights assigned to this group are inherited by all users.
46
47Administrators and project owners can grant access rights to this
48group in order to permit anonymous users to view project changes,
49without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010050to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080051identity for all other operations.
52
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020053
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010054[[non-interactive_users]]
55Non-Interactive Users
56~~~~~~~~~~~~~~~~~~~~~
57
58This is an internal user group, members of this group are not expected
Gustaf Lundha28a1d22013-05-08 15:05:12 +010059to perform interactive operations on the Gerrit web front-end.
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010060
61However, sometimes such a user may need a separate thread pool in
62order to prevent it from grabbing threads from the interactive users.
63
64These users live in a second thread pool, which separates operations
65made by the non-interactive users from the ones made by the interactive
66users. This ensures that the interactive users can keep working when
67resources are tight.
68
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020069
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010070[[project_owners]]
71Project Owners
72~~~~~~~~~~~~~~
73
74Access rights assigned to this group are always evaluated within the
75context of a project to which the access rights apply. These rights
76therefore apply to all the users who are owners of this project.
77
78By assigning access rights to this group on a parent project Gerrit
79administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010080<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010081access rights where they are resolved to the users that own the child
82project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010083<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010084avoid the need to initially configure access rights for
85newly created child projects.
86
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020087
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010088[[registered_users]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080089Registered Users
90~~~~~~~~~~~~~~~~
91
92All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +010093also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080094
95Any access rights assigned to this group are inherited by all
96users as soon as they sign-in to Gerrit. If OpenID authentication
97is being employed, moving from only 'Anonymous Users' into this
98group is very easy. Caution should be taken when assigning any
99permissions to this group.
100
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800101It is typical to assign `Code-Review -1..+1` to this group,
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800102allowing signed-in users to vote on a change, but not actually
103cause it to become approved or rejected.
104
105Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100106on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800107
108
109Account Groups
110--------------
111
112Account groups contain a list of zero or more user account members,
113added individually by a group owner. Any user account listed as
114a group member is given any access rights granted to the group.
115
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800116Every group has one other group designated as its owner. Users who
117are members of the owner group can:
118
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100119* Add users and other groups to this group
120* Remove users and other groups from this group
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800121* Change the name of this group
122* Change the description of this group
123* Change the owner of this group, to another group
124
125It is permissible for a group to own itself, allowing the group
126members to directly manage who their peers are.
127
128Newly created groups are automatically created as owning themselves,
129with the creating user as the only member. This permits the group
130creator to add additional members, and change the owner to another
131group if desired.
132
133It is somewhat common to create two groups at the same time,
134for example `Foo` and `Foo-admin`, where the latter group
135`Foo-admin` owns both itself and also group `Foo`. Users who
136are members of `Foo-admin` can thus control the membership of
137`Foo`, without actually having the access rights granted to `Foo`.
138This configuration can help prevent accidental submits when the
139members of `Foo` have submit rights on a project, and the members of
140`Foo-admin` typically do not need to have such rights.
141
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200142
Thanh Ha6eed43f2013-04-11 21:03:55 -0400143[[ldap_groups]]
144LDAP Groups
145-----------
146
147LDAP groups are Account Groups that are maintained inside of your
148LDAP instance. If you are using LDAP to manage your groups they will
149not appear in the Groups list. However you can use them just like
150regular Account Groups by prefixing your group with "ldap/" in the
151Access Control for a project. For example "ldap/foo-project" will
152add the LDAP "foo-project" group to the access list.
153
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800154
155Project Access Control Lists
156----------------------------
157
lincolnfa7bdd32010-04-22 14:23:05 -0300158A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700159project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300160through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800161
162Per-project access control lists are also supported.
163
164Users are permitted to use the maximum range granted to any of their
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800165groups on a label. For example, a user is a member of `Foo Leads`, and
166the following ACLs are granted on a project:
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800167
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100168[options="header"]
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800169|===================================================
170|Group |Reference Name |Label |Range
171|Anonymous Users |refs/heads/* |Code-Review|-1..+1
172|Registered Users|refs/heads/* |Code-Review|-1..+2
173|Foo Leads |refs/heads/* |Code-Review|-2..0
174|===================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800175
176Then the effective range permitted to be used by the user is
177`-2..+2`, as the user is a member of all three groups (see above
178about the system groups) and the maximum range is chosen (so the
179lowest value granted to any group, and the highest value granted
180to any group).
181
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800182Reference-level access control is also possible.
183
184Permissions can be set on a single reference name to match one
185branch (e.g. `refs/heads/master`), or on a reference namespace
Edwin Kempina2bf0832011-09-08 14:23:30 +0200186(e.g. `refs/heads/*`) to match any branch starting with that
187prefix. So a permission with `refs/heads/*` will match
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800188`refs/heads/master` and `refs/heads/experimental`, etc.
189
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700190Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200191by prefixing the reference name with `^`. For example
192`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700193between 1 and 8 characters long. Within a regular expression `.`
194is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100195The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
196is used for evaluation of regular expression access control
197rules. See the library documentation for details on this
198particular regular expression flavor.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700199
200References can have the current user name automatically included,
201creating dynamic access controls that change to match the currently
202logged in user. For example to provide a personal sandbox space
Edwin Kempina2bf0832011-09-08 14:23:30 +0200203to all developers, `refs/heads/sandbox/${username}/*` allowing
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700204the user 'joe' to use 'refs/heads/sandbox/joe/foo'.
205
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800206When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700207the full set of access rights to determine if the user
208is allowed to perform a given action. For example, if a user is a
209member of `Foo Leads`, they are reviewing a change destined for
210the `refs/heads/qa` branch, and the following ACLs are granted
211on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800212
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100213[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100214|===============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800215|Group |Reference Name|Label |Range |Exclusive
216|Registered Users |refs/heads/* |Code-Review| -1..+1 |
217|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
218|QA Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100219|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800220
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700221Then the effective range permitted to be used by the user is
222`-2..+2`, as the user's membership of `Foo Leads` effectively grant
223them access to the entire reference space, thanks to the wildcard.
224
225Gerrit also supports exclusive reference-level access control.
226
227It is possible to configure Gerrit to grant an exclusive ref level
228access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100229an operation on a project/reference pair. This is done by ticking
230the exclusive flag when setting the permission for the
231`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700232
233For example, if a user who is a member of `Foo Leads` tries to
234review a change destined for branch `refs/heads/qa` in a project,
235and the following ACLs are granted:
236
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100237[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100238|==============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800239|Group |Reference Name|Label |Range |Exclusive
240|Registered Users|refs/heads/* |Code-Review| -1..+1 |
241|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
242|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
Fredrik Luthander54abc352012-01-20 16:18:41 +0100243|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700244
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800245Then this user will not have `Code-Review` rights on that change,
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700246since there is an exclusive access right in place for the
247`refs/heads/qa` branch. This allows locking down access for a
248particular branch to a limited set of users, bypassing inherited
249rights and wildcards.
250
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800251In order to grant the ability to `Code-Review` to the members of
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700252`Foo Leads`, in `refs/heads/qa` then the following access rights
253would be needed:
254
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100255[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100256|==============================================================
257|Group |Reference Name|Category |Range |Exclusive
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800258|Registered Users|refs/heads/* |Code-Review| -1..+1 |
259|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
260|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
261|Foo Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100262|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700263
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200264
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800265OpenID Authentication
266~~~~~~~~~~~~~~~~~~~~~
267
268If the Gerrit instance is configured to use OpenID authentication,
269an account's effective group membership will be restricted to only
270the `Anonymous Users` and `Registered Users` groups, unless *all*
271of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700272in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800273
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200274
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800275All Projects
276~~~~~~~~~~~~
277
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700278Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800279is automatically inherited by every other project in the same
280Gerrit instance. These rights can be seen, but not modified,
281in any other project's `Access` administration tab.
282
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100283Only members of the groups with the `Administrate Server` capability
284may edit the access control list for `All-Projects`. By default this
285capability is given to the group `Administrators`, but can be given
286to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700287
288Ownership of this project cannot be delegated to another group.
289This restriction is by design. Granting ownership to another
290group gives nearly the same level of access as membership in
291`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100292permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700293
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200294
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800295Per-Project
296~~~~~~~~~~~
297
Fredrik Luthanderda867882011-12-21 18:28:40 +0100298The per-project ACL is evaluated before the global `All-Projects` ACL,
299permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100300behavior is generally only useful on the `Read` category when
301granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800302
303
Fredrik Luthander98030252012-04-13 11:01:22 +0200304[[references]]
305Special and magic references
306----------------------------
307
308The reference namespaces used in git are generally two, one for branches and
309one for tags:
310
311* +refs/heads/*+
312* +refs/tags/*+
313
314However, every reference under +refs/*+ is really available, and in Gerrit this
315opportunity for giving other refs a special meaning is used. In Gerrit they
316are sometimes used as magic/virtual references that give the push to Gerrit a
317special meaning.
318
319
320[[references_special]]
321Special references
322~~~~~~~~~~~~~~~~~~
323
324The special references have content that's either generated by Gerrit or
325contains important project configuration that Gerrit needs. When making
326changes to these references, Gerrit will take extra precautions to verify the
327contents compatibility at upload time.
328
329
330refs/changes/*
331^^^^^^^^^^^^^^
332
333Under this namespace each uploaded patch set for every change gets a static
334reference in their git. The format is convenient but still intended to scale to
335hundreds of thousands of patch sets. To access a given patch set you will
336need the change number and patch set number.
337
338[verse]
339'refs/changes/'<last two digits of change number>/
340 <change number>/
341 <patch set number>
342
343You can also find these static references linked on the page of each change.
344
345
346refs/meta/config
347^^^^^^^^^^^^^^^^
348
Matt Baker3a40c6d2013-11-26 21:01:17 -0700349This is where the Gerrit configuration of each project resides. This
Fredrik Luthander98030252012-04-13 11:01:22 +0200350branch contains several files of importance: +project.config+, +groups+ and
Matt Baker3a40c6d2013-11-26 21:01:17 -0700351+rules.pl+. Together they control access and behavior during the change
Fredrik Luthander98030252012-04-13 11:01:22 +0200352review process.
353
354
355refs/meta/dashboards/*
356^^^^^^^^^^^^^^^^^^^^^^
357
358There's a dedicated page where you can read more about
359link:user-dashboards.html[User Dashboards].
360
361
362refs/notes/review
363^^^^^^^^^^^^^^^^^
364
365Autogenerated copy of review notes for all changes in the git. Each log entry
366on the refs/notes/review branch also references the patch set on which the
367review is made. This functionality is provided by the review-notes plugin.
368
369
370[[references_magic]]
371Magic references
372~~~~~~~~~~~~~~~~
373
374These are references with added functionality to them compared to a regular
375git push operation.
376
Fredrik Luthander98030252012-04-13 11:01:22 +0200377refs/for/<branch ref>
378^^^^^^^^^^^^^^^^^^^^^
379
380Most prominent is the `refs/for/<branch ref>` reference which is the reference
381upon which we build the code review intercept before submitting a commit to
382the branch it's uploaded to.
383
384Further documentation on how to push can be found on the
385link:user-upload.html#push_create[Upload changes] page.
386
387
388refs/publish/*
389^^^^^^^^^^^^^^
390
391`refs/publish/*` is an alternative name to `refs/for/*` when pushing new changes
392and patch sets.
393
394
395refs/drafts/*
396^^^^^^^^^^^^^
397
398Push to `refs/drafts/*` creates a change like push to `refs/for/*`, except the
399resulting change remains hidden from public review. You then have the option
400of adding individual reviewers before making the change public to all. The
401change page will have a 'Publish' button which allows you to convert individual
402draft patch sets of a change into public patch sets for review.
403
404
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200405[[access_categories]]
406Access Categories
407-----------------
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800408
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200409Gerrit has several permission categories that can be granted to groups
410within projects, enabling functionality for that group's members.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800411
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200412
Fredrik Luthander69236de2013-05-09 14:50:39 +0200413
Chad Horohoe029c85a2012-06-07 16:10:14 -0400414[[category_abandon]]
415Abandon
Edwin Kempin3ff05112012-07-19 14:43:25 +0200416~~~~~~~
Chad Horohoe029c85a2012-06-07 16:10:14 -0400417
418This category controls whether users are allowed to abandon changes
419to projects in Gerrit. It can give permission to abandon a specific
420change to a given ref.
421
David Pursehousec795eb12013-07-05 14:20:28 +0900422This also grants the permission to restore a change if the user also
423has link:#category_push[push permission] on the change's destination
424ref.
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400425
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200426
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100427[[category_create]]
428Create reference
429~~~~~~~~~~~~~~~~
430
431The create reference category controls whether it is possible to
432create new references, branches or tags. This implies that the
433reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900434in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100435references (and also discard any commits in the process).
436
437It's probably most common to either permit the creation of a single
438branch in many gits (by granting permission on a parent project), or
439to grant this permission to a name pattern of branches.
440
441This permission is often given in conjunction with regular push
442branch permissions, allowing the holder of both to create new branches
443as well as bypass review for new commits on that branch.
444
David Pursehouse221d4f62012-06-08 17:38:08 +0900445To push lightweight (non-annotated) tags, grant
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100446`Create Reference` for reference name `refs/tags/*`, as lightweight
447tags are implemented just like branches in Git.
448
449For example, to grant the possibility to create new branches under the
450namespace `foo`, you have to grant this permission on
451`refs/heads/foo/*` for the group that should have it.
452Finally, if you plan to grant each user a personal namespace in
453where they are free to create as many branches as they wish, you
454should grant the create reference permission so it's possible
455to create new branches. This is done by using the special
456`${username}` keyword in the reference pattern, e.g.
457`refs/heads/sandbox/${username}/*`. If you do, it's also recommended
458you grant the users the push force permission to be able to clean up
459stale branches.
460
461
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100462[[category_forge_author]]
463Forge Author
464~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100465
466Normally Gerrit requires the author and the committer identity
467lines in a Git commit object (or tagger line in an annotated tag) to
468match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100469This permission allows users to bypass parts of that validation, which
470may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100471
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100472Permits the use of an unverified author line in commit objects.
473This can be useful when applying patches received by email from
4743rd parties, when cherry-picking changes written by others across
475branches, or when amending someone else's commit to fix up a minor
476problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100477
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100478By default this is granted to `Registered Users` in all projects,
479but a site administrator may disable it if verified authorship
480is required.
481
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100482
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100483[[category_forge_committer]]
484Forge Committer
485~~~~~~~~~~~~~~~
486
487Normally Gerrit requires the author and the committer identity
488lines in a Git commit object (or tagger line in an annotated tag) to
489match one of the registered email addresses of the uploading user.
490This permission allows users to bypass parts of that validation, which
491may be necessary when mirroring changes from an upstream project.
492
493Allows the use of an unverified committer line in commit objects, or an
494unverified tagger line in annotated tag objects. Typically this is only
495required when mirroring commits from an upstream project repository.
496
497
498[[category_forge_server]]
499Forge Server
500~~~~~~~~~~~~
501
502Normally Gerrit requires the author and the committer identity
503lines in a Git commit object (or tagger line in an annotated tag) to
504match one of the registered email addresses of the uploading user.
505This permission allows users to bypass parts of that validation, which
506may be necessary when mirroring changes from an upstream project.
507
508Allows the use of the server's own name and email on the committer
509line of a new commit object. This should only be necessary when force
510pushing a commit history which has been rewritten by 'git filter-branch'
511and that contains merge commits previously created by this Gerrit Code
512Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100513
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100514
515[[category_owner]]
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100516Owner
517~~~~~
518
519The `Owner` category controls which groups can modify the project's
520configuration. Users who are members of an owner group can:
521
522* Change the project description
523* Create/delete a branch through the web UI (not SSH)
524* Grant/revoke any access rights, including `Owner`
525
526Note that project owners implicitly have branch creation or deletion
527through the web UI, but not through SSH. To get SSH branch access
528project owners must grant an access right to a group they are a
529member of, just like for any other user.
530
531Ownership over a particular branch subspace may be delegated by
532entering a branch pattern. To delegate control over all branches
533that begin with `qa/` to the QA group, add `Owner` category
Fredrik Luthandera8b9d212012-10-10 16:05:59 +0200534for reference `refs/heads/qa/*`. Members of the QA group can
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100535further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100536`refs/heads/qa/`. See <<project_owners,project owners>> to find
537out more about this role.
538
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100539
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100540[[category_push]]
541Push
542~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100543
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100544This category controls how users are allowed to upload new commits
545to projects in Gerrit. It can either give permission to push
546directly into a branch, bypassing any code review process
547that would otherwise be used. Or it may give permission to upload
548new changes for code review, this depends on which namespace the
549permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100550
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100551
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100552[[category_push_direct]]
553Direct Push
554^^^^^^^^^^^
555
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100556Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200557Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100558link:access-control.html#category_create['Create Reference']
559category. Deletion of existing branches is rejected. This is the
560safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100561
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100562* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100563+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100564Allows an existing branch to be deleted. Since a force push is
565effectively a delete immediately followed by a create, but performed
566atomically on the server and logged, this option also permits forced
567push updates to branches. Enabling this option allows existing commits
568to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100569
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100570The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100571take advantage of Gerrit's access control features and do not need
572its code review functionality. Projects that need to require code
573reviews should not grant this category.
574
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100575
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100576[[category_push_review]]
577Upload To Code Review
578^^^^^^^^^^^^^^^^^^^^^
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100579
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100580The `Push` access right granted on the namespace
581`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
582commit to the project's `refs/for/BRANCH` namespace, creating a new
583change for code review.
584
585A user must be able to clone or fetch the project in order to create
586a new commit on their local system, so in practice they must also
587have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100588
589For an open source, public Gerrit installation, it is common to
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100590grant `Read` and `Push` for `refs/for/refs/heads/*`
591to `Registered Users` in the `All-Projects` ACL. For more
592private installations, its common to simply grant `Read` and
593`Push` for `refs/for/refs/heads/*` to all users of a project.
594
595* Force option
596+
597The force option has no function when granted to a branch in the
598`refs/for/refs/heads/*` namespace.
599
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100600
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100601[[category_push_merge]]
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100602Push Merge Commits
Yuxuan 'fishy' Wang84065aa2013-08-29 15:10:24 -0700603~~~~~~~~~~~~~~~~~~
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100604
Magnus Bäck282c1022012-04-18 15:39:17 -0400605The `Push Merge Commit` access right permits the user to upload merge
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100606commits. It's an add-on to the <<category_push,Push>> access right, and
Magnus Bäck282c1022012-04-18 15:39:17 -0400607so it won't be sufficient with only `Push Merge Commit` granted for a
608push to happen. Some projects wish to restrict merges to being created
609by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100610merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100611
Jonathan Niederdaf8bd42013-10-01 15:06:14 -0700612The reference name connected to a `Push Merge Commit` entry must always
613be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
614This applies even for an entry that complements a `Push` entry for
615`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
616the intention of the `Push Merge Commit` entry is to allow direct pushes
617of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100618
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200619
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100620[[category_push_annotated]]
621Push Annotated Tag
622~~~~~~~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100623
David Pursehouse690cebe2012-12-12 19:22:45 +0900624This category permits users to push an annotated tag object into the
625project's repository. Typically this would be done with a command line
626such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100627
628====
629 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
630====
631
David Pursehouse690cebe2012-12-12 19:22:45 +0900632Or:
633
634====
635 git push https://HOST/PROJECT tag v1.0
636====
637
David Pursehouseb429ce12012-12-12 11:04:40 +0900638Tags must be annotated (created with `git tag -a`), should exist in
639the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100640
641This category is intended to be used to publish tags when a project
642reaches a stable release point worth remembering in history.
643
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100644It allows for a new annotated (unsigned) tag to be created. The
645tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100646
647To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100648as tags mirrored from an upstream project), `Forge Committer Identity`
649must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100650
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100651To push lightweight (non annotated) tags, grant
652<<category_create,`Create Reference`>> for reference name
653`refs/tags/*`, as lightweight tags are implemented just like
654branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100655
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100656To delete or overwrite an existing tag, grant `Push` with the force
657option enabled for reference name `refs/tags/*`, as deleting a tag
658requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100659
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100660
David Pursehouseb429ce12012-12-12 11:04:40 +0900661[[category_push_signed]]
662Push Signed Tag
663~~~~~~~~~~~~~~~
664
David Pursehouse690cebe2012-12-12 19:22:45 +0900665This category permits users to push a PGP signed tag object into the
666project's repository. Typically this would be done with a command
667line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900668
669====
670 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
671====
672
David Pursehouse690cebe2012-12-12 19:22:45 +0900673Or:
674
675====
676 git push https://HOST/PROJECT tag v1.0
677====
678
David Pursehouseb429ce12012-12-12 11:04:40 +0900679Tags must be signed (created with `git tag -s`), should exist in the
680`refs/tags/` namespace, and should be new.
681
682
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100683[[category_read]]
684Read
685~~~~
686
687The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100688changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100689A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100690changes, or any of its data.
691
692This category has a special behavior, where the per-project ACL is
693evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100694ACL has granted `Read` with 'DENY', and does not otherwise grant
695`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100696is ignored. This behavior is useful to hide a handful of projects
697on an otherwise public server.
698
699For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100700`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
701casual browsing of any project's changes, as well as fetching any
702project's repository over SSH or HTTP. New projects can be
703temporarily hidden from public view by granting `Read` with 'DENY'
704to `Anonymous Users` and granting `Read` to the project owner's
705group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100706
707For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100708source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100709typical, enabling read access only to those users who have been
710able to authenticate through the HTTP access controls. This may
711be suitable in a corporate deployment if the HTTP access control
712is already restricted to the correct set of users.
713
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100714
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200715[[category_rebase]]
716Rebase
717~~~~~~
718
719This category permits users to rebase changes via the web UI by pushing
720the `Rebase Change` button.
721
722The change owner and submitters can always rebase changes in the web UI
723(even without having the `Rebase` access right assigned).
724
725Users without this access right who are able to upload new patch sets
726can still do the rebase locally and upload the rebased commit as a new
727patch set.
728
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200729
Chad Horohoec626f3c2012-09-13 11:04:20 -0700730[[category_remove_reviewer]]
731Remove Reviewer
732~~~~~~~~~~~~~~~
733
734This category permits users to remove other users from the list of
735reviewers on a change.
736
737The change owner, project owner and site administrator can always
738remove reviewers (even without having the `Remove Reviewer` access
739right assigned).
740
741Users without this access right can only remove themselves from the
742reviewer list on a change.
743
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200744
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200745[[category_review_labels]]
746Review Labels
747~~~~~~~~~~~~~
748
749For every configured label `My-Name` in the project, there is a
750corresponding permission `label-My-Name` with a range corresponding to
Shawn Pearce9d783122013-06-11 18:18:03 -0700751the defined values. There is also a corresponding `labelAs-My-Name`
752permission that enables editing another user's label.
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200753
754Gerrit comes pre-configured with a default 'Code-Review' label that can
755be granted to groups within projects, enabling functionality for that
756group's members. link:config-labels.html[Custom labels] may also be
757defined globally or on a per-project basis.
758
759
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100760[[category_submit]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800761Submit
762~~~~~~
763
764This category permits users to push the `Submit Patch Set n` button
765on the web UI.
766
767Submitting a change causes it to be merged into the destination
768branch as soon as possible, making it a permanent part of the
769project's history.
770
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800771In order to submit, all labels (such as `Verified` and `Code-Review`,
772above) must enable submit, and also must not block it. See above for
773details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800774
Edwin Kempinbfa06212013-04-04 16:06:39 +0200775To link:user-upload.html#auto_merge[immediately submit a change on push]
776the caller needs to have the Submit permission on `refs/for/<ref>`
777(e.g. on `refs/for/refs/heads/master`).
778
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100779
David Pursehouse5ae73002012-11-01 15:22:26 +0900780[[category_view_drafts]]
781View Drafts
782~~~~~~~~~~~
783
784This category permits users to view draft changes uploaded by other
785users.
786
787The change owner and any explicitly added reviewers can always see
788draft changes (even without having the `View Drafts` access right
789assigned).
790
791
David Pursehousebe7f4582012-12-12 11:21:29 +0900792[[category_publish_drafts]]
793Publish Drafts
794~~~~~~~~~~~~~~
795
796This category permits users to publish draft changes uploaded by other
797users.
798
799The change owner can always publish draft changes (even without having
800the `Publish Drafts` access right assigned).
801
802
803[[category_delete_drafts]]
804Delete Drafts
805~~~~~~~~~~~~~
806
807This category permits users to delete draft changes uploaded by other
808users.
809
810The change owner can always delete draft changes (even without having
811the `Delete Drafts` access right assigned).
812
813
David Pursehouse59aee362012-11-15 17:25:17 +0900814[[category_edit_topic_name]]
815Edit Topic Name
816~~~~~~~~~~~~~~~
817
818This category permits users to edit the topic name of a change that
819is uploaded for review.
820
821The change owner, branch owners, project owners, and site administrators
822can always edit the topic name (even without having the `Edit Topic Name`
823access right assigned).
824
Edwin Kempin1f77b532013-11-08 07:16:31 +0100825Whether the topic can be edited on closed changes can be controlled
826by the 'Force Edit' flag. If this flag is not set the topic can only be
827edited on open changes.
828
David Pursehouse59aee362012-11-15 17:25:17 +0900829
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100830Examples of typical roles in a project
831--------------------------------------
832
833Below follows a set of typical roles on a server and which access
834rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900835general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100836brand new Gerrit instance.
837
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200838
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100839[[examples_contributor]]
840Contributor
841~~~~~~~~~~~
842
843This is the typical user on a public server. They are able to read
844your project and upload new changes to it. They are able to give
845feedback on other changes as well, but are unable to block or approve
846any changes.
847
848Suggested access rights to grant:
849
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800850* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
851* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
852* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100853
854
Fredrik Luthander654161c2012-01-31 14:42:36 +0100855[[examples_developer]]
856Developer
857~~~~~~~~~
858
859This is the typical core developer on a public server. They are able
860to read the project, upload changes to a branch. They are allowed to
861push merge commits to merge branches together. Also, they are allowed
862to forge author identity, thus handling commits belonging to others
863than themselves, effectively allowing them to transfer commits
864between different branches.
865
866They are furthermore able to code review and verify commits, and
867eventually submit them. If you have an automated CI system that
868builds all uploaded patch sets you might want to skip the
869verification rights for the developer and let the CI system do that
870exclusively.
871
872Suggested access rights to grant:
873
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800874* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
875* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
876* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
877* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
878* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-2' to '+2' for 'refs/heads/*'
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200879* link:config-labels.html#label_Verified[`Label: Verified`] with range '-1' to '+1' for 'refs/heads/*'
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800880* xref:category_submit[`Submit`]
Fredrik Luthander654161c2012-01-31 14:42:36 +0100881
882If the project is small or the developers are seasoned it might make
883sense to give them the freedom to push commits directly to a branch.
884
885Optional access rights to grant:
886
887* <<category_push,`Push`>> to 'refs/heads/*'
888* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
889
890
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100891[[examples_cisystem]]
892CI system
893~~~~~~~~~
894
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100895A typical Continuous Integration system should be able to download new changes
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100896to build and then leave a verdict somehow.
897
898As an example, the popular
899link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
900for Jenkins/Hudson can set labels at:
901
902* The start of a build
903* A successful build
904* An unstable build (tests fails)
905* A failed build
906
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200907Usually the range chosen for this verdict is the `Verified` label. Depending on
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100908the size of your project and discipline of involved developers you might want
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200909to limit access right to the +1 `Verified` label to the CI system only. That
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100910way it's guaranteed that submitted commits always get built and pass tests
911successfully.
912
913If the build doesn't complete successfully the CI system can set the
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200914`Verified` label to -1. However that means that a failed build will block
915submit of the change even if someone else sets `Verified` +1. Depending on the
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100916project and how much the CI system can be trusted for accurate results, a
917blocking label might not be feasible. A recommended alternative is to set the
918label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900919shows a red label in the Gerrit UI. Optionally, to enable the possibility to
920deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100921possible to set `Code-review` +1 as well.
922
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200923If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100924submitted changes for upload to other branches under certain conditions. This
925is probably not the first step of what a project wants to automate however,
926and so the push right can be found under the optional section.
927
928Suggested access rights to grant, that won't block changes:
929
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800930* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
931* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '0' for 'refs/heads/*'
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200932* link:config-labels.html#label_Verified[`Label: Verified`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100933
934Optional access rights to grant:
935
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800936* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
937* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100938
939
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100940[[examples_integrator]]
941Integrator
942~~~~~~~~~~
943
944Integrators are like developers but with some additional rights granted due
945to their administrative role in a project. They can upload or push any commit
946with any committer email (not just their own) and they can also create new
947tags and branches.
948
949Suggested access rights to grant:
950
951* <<examples_developer,Developer rights>>
952* <<category_push,`Push`>> to 'refs/heads/*'
953* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200954* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100955* <<category_create,`Create Reference`>> to 'refs/heads/*'
956* <<category_push_annotated,`Push Annotated Tag`>> to 'refs/tags/*'
957
958
Fredrik Luthander9c645362012-03-22 18:10:42 +0100959[[examples_project-owner]]
960Project owner
961~~~~~~~~~~~~~
962
963The project owner is almost like an integrator but with additional destructive
964power in the form of being able to delete branches. Optionally these users
965also have the power to configure access rights in gits assigned to them.
966
967[WARNING]
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100968These users should be really knowledgeable about git, for instance knowing why
Fredrik Luthander9c645362012-03-22 18:10:42 +0100969tags never should be removed from a server. This role is granted potentially
970destructive access rights and cleaning up after such a mishap could be time
971consuming!
972
973Suggested access rights to grant:
974
975* <<examples_integrator,Integrator rights>>
976* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
977
978Optional access right to grant:
979
980* <<category_owner,`Owner`>> in the gits they mostly work with.
981
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200982
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100983[[examples_administrator]]
984Administrator
985~~~~~~~~~~~~~
986
987The administrator role is the most powerful role known in the Gerrit universe.
988This role may grant itself (or others) any access right, and it already has
989all capabilities granted as well. By default the
990<<administrators,`Administrators` group>> is the group that has this role.
991
992Mandatory access rights:
993
994* <<capability_administrateServer,The `Administrate Server` capability>>
995
996Suggested access rights to grant:
997
998* <<examples_project-owner,Project owner rights>>
999
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001000
Sasa Zivkovd589f462013-02-12 14:27:09 +01001001Enforcing site wide access policies
1002-----------------------------------
1003
1004By granting the <<category_owner,`Owner`>> access right on the `refs/*` to a
1005group, Gerrit administrators can delegate the responsibility of maintaining
1006access rights for that project to that group.
1007
1008In a corporate deployment it is often necessary to enforce some access
1009policies. An example could be that no-one can update or delete a tag, not even
1010the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
1011purpose as project owners can grant themselves any access right they wish and,
1012thus, effectively override any inherited access rights from the
1013"`All-Projects`" or some other common parent project.
1014
1015What is needed is a mechanism to block a permission in a parent project so
1016that even project owners cannot allow a blocked permission in their child
1017project. Still, project owners should retain the possibility to manage all
1018non-blocked rules as they wish. This gives best of both worlds:
1019
1020* Gerrit administrators can concentrate on enforcing site wide policies
1021 and providing a meaningful set of default access permissions
1022* Project owners can manage access rights of their projects without a danger
1023 of violating a site wide policy
1024
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001025
Edwin Kempin60ab8532013-03-27 14:33:46 +01001026[[block]]
Sasa Zivkovd589f462013-02-12 14:27:09 +01001027'BLOCK' access rule
1028~~~~~~~~~~~~~~~~~~~
1029
1030The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK' rule cannot
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001031be overridden in the inheriting project. Any 'ALLOW' rule, from a different
1032access section or from an inheriting project, which conflicts with an
1033inherited 'BLOCK' rule will not be honored. Searching for 'BLOCK' rules, in
Sasa Zivkovd589f462013-02-12 14:27:09 +01001034the chain of parent projects, ignores the Exclusive flag that is normally
1035applied to access sections.
1036
1037A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1038force or not. A blocking force push rule blocks only force pushes, but
1039allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1040
1041It is also possible to block label ranges. To block a group 'X' from voting
1042'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1043range intact we would define:
1044
1045====
1046 [access "refs/heads/*"]
1047 label-Code-Review = block -2..+2 group X
1048====
1049
1050The interpretation of the 'min..max' range in case of a blocking rule is: block
1051every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1052means that the range '-1..+1' is not affected by this block.
1053
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001054'BLOCK' and 'ALLOW' rules in the same access section
1055~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1056
1057When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1058the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1059
1060====
1061 [access "refs/heads/*"]
1062 push = block group X
1063 push = group Y
1064====
1065
1066In this case a user which is a member of the group 'Y' will still be allowed to
1067push to 'refs/heads/*' even if it is a member of the group 'X'.
1068
1069NOTE: An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
1070inside the same access section of the same project. An 'ALLOW' rule in a
1071different access section of the same project or in any access section in an
1072inheriting project cannot override a 'BLOCK' rule.
1073
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001074
Sasa Zivkovd589f462013-02-12 14:27:09 +01001075Examples
1076~~~~~~~~
1077
1078The following examples show some possible use cases for the 'BLOCK' rules.
1079
1080Make sure no one can update or delete a tag
1081^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1082
1083This requirement is quite common in a corporate deployment where
1084reproducibility of a build must be guaranteed. To achieve that we block 'push'
1085permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1086
1087====
1088 [access "refs/tags/*"]
1089 push = block group Anonymous Users
1090====
1091
1092By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1093everyone as everyone is a member of that group. Note that the permission to
1094create a tag is still necessary. Assuming that only <<category_owner,project
1095owners>> are allowed to create tags, we would extend the example above:
1096
1097====
1098 [access "refs/tags/*"]
1099 push = block group Anonymous Users
1100 create = group Project Owners
1101 pushTag = group Project Owners
1102====
Fredrik Luthander9c645362012-03-22 18:10:42 +01001103
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001104
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001105Let only a dedicated group vote in a special category
1106^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1107
1108Assume there is a more restrictive process for submitting changes in stable
1109release branches which is manifested as a new voting category
1110'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1111group can vote in this category and that even project owners cannot approve
1112this category. We have to block everyone except the 'Release Engineers' to vote
1113in this category and, of course, allow 'Release Engineers' to vote in that
1114category. In the "`All-Projects`" we define the following rules:
1115
1116====
1117 [access "refs/heads/stable*"]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001118 label-Release-Process = block -1..+1 group Anonymous Users
1119 label-Release-Process = -1..+1 group Release Engineers
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001120====
1121
David Pursehouse8becc2a2013-04-23 18:51:04 +09001122[[global_capabilities]]
1123Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001124-------------------
1125
David Pursehouse8becc2a2013-04-23 18:51:04 +09001126The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001127the server can perform which usually affect the entire
1128server in some way. The administrators may delegate these
1129capabilities to trusted groups of users.
1130
1131Delegation of capabilities allows groups to be granted a subset of
1132administrative capabilities without being given complete
1133administrative control of the server. This makes it possible to
1134keep fewer users in the administrators group, even while spreading
1135much of the server administration burden out to more users.
1136
David Pursehouse8becc2a2013-04-23 18:51:04 +09001137Global capabilities are assigned to groups in the access rights settings
1138of the root project ("`All-Projects`").
1139
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001140Below you find a list of capabilities available:
1141
1142
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001143[[capability_accessDatabase]]
1144Access Database
1145~~~~~~~~~~~~~~~
1146
1147Allow users to access the database using the `gsql` command.
1148
1149
Fredrik Luthander426885f2012-02-13 09:56:57 +01001150[[capability_administrateServer]]
1151Administrate Server
1152~~~~~~~~~~~~~~~~~~~
1153
1154This is in effect the owner and administrator role of the Gerrit
1155instance. Any members of a group granted this capability will be
1156able to grant any access right to any group. They will also have all
1157capabilities granted to them automatically.
1158
1159
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001160[[capability_createAccount]]
1161Create Account
1162~~~~~~~~~~~~~~
1163
Fredrik Luthander79d38152012-03-13 09:52:22 +01001164Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001165This capability allows the granted group members to create non-interactive
1166service accounts. These service accounts are generally used for automation
1167and made to be members of the
1168link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1169
1170
Fredrik Luthander79d38152012-03-13 09:52:22 +01001171[[capability_createGroup]]
1172Create Group
1173~~~~~~~~~~~~
1174
1175Allow group creation. Groups are used to grant users access to different
1176actions in projects. This capability allows the granted group members to
1177either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1178
1179
1180[[capability_createProject]]
1181Create Project
1182~~~~~~~~~~~~~~
1183
1184Allow project creation. This capability allows the granted group to
1185either link:cmd-create-project.html[create new git projects via ssh]
1186or via the web UI.
1187
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001188
Sasa Zivkov812f4892012-06-21 16:25:21 +02001189[[capability_emailReviewers]]
1190Email Reviewers
1191~~~~~~~~~~~~~~~
1192
1193Allow or deny sending email to change reviewers and watchers. This can be used
1194to deny build bots from emailing reviewers and people who watch the change.
1195Instead, only the authors of the change and those who starred it will be
1196emailed. The allow rules are evaluated before deny rules, however the default
1197is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001198
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001199
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001200[[capability_flushCaches]]
1201Flush Caches
1202~~~~~~~~~~~~
1203
Fredrik Luthander48603002012-03-21 18:17:17 +01001204Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001205group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1206
1207[NOTE]
1208This capability doesn't imply permissions to the show-caches command. For that
1209you need the <<capability_viewCaches,view caches capability>>.
1210
1211
David Pursehousecbd22ac2013-06-09 08:03:14 +09001212[[capability_generateHttpPassword]]
1213Generate HTTP Password
1214~~~~~~~~~~~~~~~~~~~~~~
1215
1216Allow the user to generate HTTP passwords for other users. Typically this would
1217be assigned to a non-interactive users group.
1218
1219
Fredrik Luthander46843022012-03-13 16:11:02 +01001220[[capability_kill]]
1221Kill Task
1222~~~~~~~~~
1223
1224Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1225kill command ends tasks that currently occupy the Gerrit server, usually
1226a replication task or a user initiated task such as an upload-pack or
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001227receive-pack.
Fredrik Luthander46843022012-03-13 16:11:02 +01001228
1229
1230[[capability_priority]]
1231Priority
1232~~~~~~~~
1233
1234This capability allows users to use
1235link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1236link:access-control.html#non-interactive_users['Non-Interactive Users'].
1237It's a binary value in that granted users either have access to the thread
1238pool, or they don't.
1239
1240There are three modes for this capability and they're listed by rising
1241priority:
1242
1243No capability configured.::
1244The user isn't a member of a group with any priority capability granted. By
1245default the user is then in the 'INTERACTIVE' thread pool.
1246
1247'BATCH'::
1248If there's a thread pool configured for 'Non-Interactive Users' and a user is
1249granted the priority capability with the 'BATCH' mode selected, the user ends
1250up in the separate batch user thread pool. This is true unless the user is
1251also granted the below 'INTERACTIVE' option.
1252
1253'INTERACTIVE'::
1254If a user is granted the priority capability with the 'INTERACTIVE' option,
1255regardless if they also have the 'BATCH' option or not, they are in the
1256'INTERACTIVE' thread pool.
1257
1258
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001259[[capability_queryLimit]]
1260Query Limit
1261~~~~~~~~~~~
1262
1263Allow site administrators to configure the query limit for users to
1264be above the default hard-coded value of 500. Administrators can add
David Pursehouseb5d99aaf2013-08-09 11:02:48 +09001265a global block to `All-Projects` with group(s) that should have different
1266limits.
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001267
1268When applying a query limit to a user the largest value granted by
1269any of their groups is used.
1270
1271This limit applies not only to the link:cmd-query.html[`gerrit query`]
1272command, but also to the web UI results pagination size.
1273
1274
Shawn Pearcebb027b02013-06-10 14:35:39 -07001275[[capability_runAs]]
1276Run As
1277~~~~~~
1278
Shawn Pearcef3ffd082013-06-12 11:21:35 -07001279Allow users to impersonate any other user with the `X-Gerrit-RunAs`
1280HTTP header on REST API calls, or the link:cmd-suexec.html[suexec]
1281SSH command.
1282
1283When impersonating an administrator the Administrate Server capability
1284is not honored. This security feature tries to prevent a role with
1285Run As capability from modifying the access controls in All-Projects,
1286however modification may still be possible if the impersonated user
1287has permission to push or submit changes on `refs/meta/config`. Run
1288As also blocks using most capabilities including Create User, Run
1289Garbage Collection, etc., unless the capability is also explicitly
1290granted to a group the administrator is a member of.
1291
1292Administrators do not automatically inherit this capability; it must
1293be explicitly granted.
Shawn Pearcebb027b02013-06-10 14:35:39 -07001294
1295
Edwin Kempin619169b2012-02-09 15:47:52 +01001296[[capability_runGC]]
1297Run Garbage Collection
1298~~~~~~~~~~~~~~~~~~~~~~
1299
1300Allow users to run the Git garbage collection for the repositories of
1301all projects.
1302
1303
Ed Bartoshd168b812013-04-13 20:15:58 +03001304[[capability_streamEvents]]
1305Stream Events
1306~~~~~~~~~~~~~
1307
1308Allow performing streaming of Gerrit events. This capability
1309allows the granted group to
1310link:cmd-stream-events.html[stream Gerrit events via ssh].
1311
1312
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001313[[capability_viewCaches]]
1314View Caches
1315~~~~~~~~~~~
1316
Fredrik Luthander48603002012-03-21 18:17:17 +01001317Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001318the granted group to
1319link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1320
1321
Fredrik Luthander48603002012-03-21 18:17:17 +01001322[[capability_viewConnections]]
1323View Connections
1324~~~~~~~~~~~~~~~~
1325
1326Allow querying for status of Gerrit's current client connections. This
1327capability allows the granted group to
1328link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1329
1330
1331[[capability_viewQueue]]
1332View Queue
1333~~~~~~~~~~
1334
1335Allow querying for status of Gerrit's internal task queue. This capability
1336allows the granted group to
1337link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1338
1339
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001340GERRIT
1341------
1342Part of link:index.html[Gerrit Code Review]