blob: a3bfe2715b08bfc1dea549855e099e66d2d2138f [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
349This is where the Gerrit configuration of each project is residing. This
350branch contains several files of importance: +project.config+, +groups+ and
351+rules.pl+. Torgether they control access and behaviour during the change
352review 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
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400422This also grants the permission to restore a change if the change
423can be uploaded.
424
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200425
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100426[[category_create]]
427Create reference
428~~~~~~~~~~~~~~~~
429
430The create reference category controls whether it is possible to
431create new references, branches or tags. This implies that the
432reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900433in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100434references (and also discard any commits in the process).
435
436It's probably most common to either permit the creation of a single
437branch in many gits (by granting permission on a parent project), or
438to grant this permission to a name pattern of branches.
439
440This permission is often given in conjunction with regular push
441branch permissions, allowing the holder of both to create new branches
442as well as bypass review for new commits on that branch.
443
David Pursehouse221d4f62012-06-08 17:38:08 +0900444To push lightweight (non-annotated) tags, grant
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100445`Create Reference` for reference name `refs/tags/*`, as lightweight
446tags are implemented just like branches in Git.
447
448For example, to grant the possibility to create new branches under the
449namespace `foo`, you have to grant this permission on
450`refs/heads/foo/*` for the group that should have it.
451Finally, if you plan to grant each user a personal namespace in
452where they are free to create as many branches as they wish, you
453should grant the create reference permission so it's possible
454to create new branches. This is done by using the special
455`${username}` keyword in the reference pattern, e.g.
456`refs/heads/sandbox/${username}/*`. If you do, it's also recommended
457you grant the users the push force permission to be able to clean up
458stale branches.
459
460
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100461[[category_forge_author]]
462Forge Author
463~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100464
465Normally Gerrit requires the author and the committer identity
466lines in a Git commit object (or tagger line in an annotated tag) to
467match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100468This permission allows users to bypass parts of that validation, which
469may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100470
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100471Permits the use of an unverified author line in commit objects.
472This can be useful when applying patches received by email from
4733rd parties, when cherry-picking changes written by others across
474branches, or when amending someone else's commit to fix up a minor
475problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100476
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100477By default this is granted to `Registered Users` in all projects,
478but a site administrator may disable it if verified authorship
479is required.
480
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100481
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100482[[category_forge_committer]]
483Forge Committer
484~~~~~~~~~~~~~~~
485
486Normally Gerrit requires the author and the committer identity
487lines in a Git commit object (or tagger line in an annotated tag) to
488match one of the registered email addresses of the uploading user.
489This permission allows users to bypass parts of that validation, which
490may be necessary when mirroring changes from an upstream project.
491
492Allows the use of an unverified committer line in commit objects, or an
493unverified tagger line in annotated tag objects. Typically this is only
494required when mirroring commits from an upstream project repository.
495
496
497[[category_forge_server]]
498Forge Server
499~~~~~~~~~~~~
500
501Normally Gerrit requires the author and the committer identity
502lines in a Git commit object (or tagger line in an annotated tag) to
503match one of the registered email addresses of the uploading user.
504This permission allows users to bypass parts of that validation, which
505may be necessary when mirroring changes from an upstream project.
506
507Allows the use of the server's own name and email on the committer
508line of a new commit object. This should only be necessary when force
509pushing a commit history which has been rewritten by 'git filter-branch'
510and that contains merge commits previously created by this Gerrit Code
511Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100512
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100513
514[[category_owner]]
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100515Owner
516~~~~~
517
518The `Owner` category controls which groups can modify the project's
519configuration. Users who are members of an owner group can:
520
521* Change the project description
522* Create/delete a branch through the web UI (not SSH)
523* Grant/revoke any access rights, including `Owner`
524
525Note that project owners implicitly have branch creation or deletion
526through the web UI, but not through SSH. To get SSH branch access
527project owners must grant an access right to a group they are a
528member of, just like for any other user.
529
530Ownership over a particular branch subspace may be delegated by
531entering a branch pattern. To delegate control over all branches
532that begin with `qa/` to the QA group, add `Owner` category
Fredrik Luthandera8b9d212012-10-10 16:05:59 +0200533for reference `refs/heads/qa/*`. Members of the QA group can
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100534further refine access, but only for references that begin with
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100535`refs/heads/qa/`. See <<project_owners,project owners>> to find
536out more about this role.
537
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100538
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100539[[category_push]]
540Push
541~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100542
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100543This category controls how users are allowed to upload new commits
544to projects in Gerrit. It can either give permission to push
545directly into a branch, bypassing any code review process
546that would otherwise be used. Or it may give permission to upload
547new changes for code review, this depends on which namespace the
548permission is granted to.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100549
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100550
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100551[[category_push_direct]]
552Direct Push
553^^^^^^^^^^^
554
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100555Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200556Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100557link:access-control.html#category_create['Create Reference']
558category. Deletion of existing branches is rejected. This is the
559safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100560
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100561* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100562+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100563Allows an existing branch to be deleted. Since a force push is
564effectively a delete immediately followed by a create, but performed
565atomically on the server and logged, this option also permits forced
566push updates to branches. Enabling this option allows existing commits
567to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100568
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100569The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100570take advantage of Gerrit's access control features and do not need
571its code review functionality. Projects that need to require code
572reviews should not grant this category.
573
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100574
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100575[[category_push_review]]
576Upload To Code Review
577^^^^^^^^^^^^^^^^^^^^^
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100578
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100579The `Push` access right granted on the namespace
580`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
581commit to the project's `refs/for/BRANCH` namespace, creating a new
582change for code review.
583
584A user must be able to clone or fetch the project in order to create
585a new commit on their local system, so in practice they must also
586have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100587
588For an open source, public Gerrit installation, it is common to
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100589grant `Read` and `Push` for `refs/for/refs/heads/*`
590to `Registered Users` in the `All-Projects` ACL. For more
591private installations, its common to simply grant `Read` and
592`Push` for `refs/for/refs/heads/*` to all users of a project.
593
594* Force option
595+
596The force option has no function when granted to a branch in the
597`refs/for/refs/heads/*` namespace.
598
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100599
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100600[[category_push_merge]]
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100601Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100602~~~~~~~~~~~~~~~~~~~~
603
Magnus Bäck282c1022012-04-18 15:39:17 -0400604The `Push Merge Commit` access right permits the user to upload merge
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100605commits. It's an add-on to the <<category_push,Push>> access right, and
Magnus Bäck282c1022012-04-18 15:39:17 -0400606so it won't be sufficient with only `Push Merge Commit` granted for a
607push to happen. Some projects wish to restrict merges to being created
608by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100609merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100610
Magnus Bäck282c1022012-04-18 15:39:17 -0400611The reference name connected to a `Push Merge Commit` entry must always
612be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
613This applies even for an entry that complements a `Push` entry for
614`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
615the intention of the `Push Merge Commit` entry is to allow direct pushes
616of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100617
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200618
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100619[[category_push_annotated]]
620Push Annotated Tag
621~~~~~~~~~~~~~~~~~~
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100622
David Pursehouse690cebe2012-12-12 19:22:45 +0900623This category permits users to push an annotated tag object into the
624project's repository. Typically this would be done with a command line
625such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100626
627====
628 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
629====
630
David Pursehouse690cebe2012-12-12 19:22:45 +0900631Or:
632
633====
634 git push https://HOST/PROJECT tag v1.0
635====
636
David Pursehouseb429ce12012-12-12 11:04:40 +0900637Tags must be annotated (created with `git tag -a`), should exist in
638the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100639
640This category is intended to be used to publish tags when a project
641reaches a stable release point worth remembering in history.
642
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100643It allows for a new annotated (unsigned) tag to be created. The
644tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100645
646To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100647as tags mirrored from an upstream project), `Forge Committer Identity`
648must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100649
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100650To push lightweight (non annotated) tags, grant
651<<category_create,`Create Reference`>> for reference name
652`refs/tags/*`, as lightweight tags are implemented just like
653branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100654
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100655To delete or overwrite an existing tag, grant `Push` with the force
656option enabled for reference name `refs/tags/*`, as deleting a tag
657requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100658
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100659
David Pursehouseb429ce12012-12-12 11:04:40 +0900660[[category_push_signed]]
661Push Signed Tag
662~~~~~~~~~~~~~~~
663
David Pursehouse690cebe2012-12-12 19:22:45 +0900664This category permits users to push a PGP signed tag object into the
665project's repository. Typically this would be done with a command
666line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900667
668====
669 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
670====
671
David Pursehouse690cebe2012-12-12 19:22:45 +0900672Or:
673
674====
675 git push https://HOST/PROJECT tag v1.0
676====
677
David Pursehouseb429ce12012-12-12 11:04:40 +0900678Tags must be signed (created with `git tag -s`), should exist in the
679`refs/tags/` namespace, and should be new.
680
681
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100682[[category_read]]
683Read
684~~~~
685
686The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100687changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100688A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100689changes, or any of its data.
690
691This category has a special behavior, where the per-project ACL is
692evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100693ACL has granted `Read` with 'DENY', and does not otherwise grant
694`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100695is ignored. This behavior is useful to hide a handful of projects
696on an otherwise public server.
697
698For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100699`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
700casual browsing of any project's changes, as well as fetching any
701project's repository over SSH or HTTP. New projects can be
702temporarily hidden from public view by granting `Read` with 'DENY'
703to `Anonymous Users` and granting `Read` to the project owner's
704group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100705
706For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100707source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100708typical, enabling read access only to those users who have been
709able to authenticate through the HTTP access controls. This may
710be suitable in a corporate deployment if the HTTP access control
711is already restricted to the correct set of users.
712
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100713
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200714[[category_rebase]]
715Rebase
716~~~~~~
717
718This category permits users to rebase changes via the web UI by pushing
719the `Rebase Change` button.
720
721The change owner and submitters can always rebase changes in the web UI
722(even without having the `Rebase` access right assigned).
723
724Users without this access right who are able to upload new patch sets
725can still do the rebase locally and upload the rebased commit as a new
726patch set.
727
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200728
Chad Horohoec626f3c2012-09-13 11:04:20 -0700729[[category_remove_reviewer]]
730Remove Reviewer
731~~~~~~~~~~~~~~~
732
733This category permits users to remove other users from the list of
734reviewers on a change.
735
736The change owner, project owner and site administrator can always
737remove reviewers (even without having the `Remove Reviewer` access
738right assigned).
739
740Users without this access right can only remove themselves from the
741reviewer list on a change.
742
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200743
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200744[[category_review_labels]]
745Review Labels
746~~~~~~~~~~~~~
747
748For every configured label `My-Name` in the project, there is a
749corresponding permission `label-My-Name` with a range corresponding to
750the defined values.
751
752Gerrit comes pre-configured with a default 'Code-Review' label that can
753be granted to groups within projects, enabling functionality for that
754group's members. link:config-labels.html[Custom labels] may also be
755defined globally or on a per-project basis.
756
757
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100758[[category_submit]]
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800759Submit
760~~~~~~
761
762This category permits users to push the `Submit Patch Set n` button
763on the web UI.
764
765Submitting a change causes it to be merged into the destination
766branch as soon as possible, making it a permanent part of the
767project's history.
768
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800769In order to submit, all labels (such as `Verified` and `Code-Review`,
770above) must enable submit, and also must not block it. See above for
771details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800772
Edwin Kempinbfa06212013-04-04 16:06:39 +0200773To link:user-upload.html#auto_merge[immediately submit a change on push]
774the caller needs to have the Submit permission on `refs/for/<ref>`
775(e.g. on `refs/for/refs/heads/master`).
776
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100777
David Pursehouse5ae73002012-11-01 15:22:26 +0900778[[category_view_drafts]]
779View Drafts
780~~~~~~~~~~~
781
782This category permits users to view draft changes uploaded by other
783users.
784
785The change owner and any explicitly added reviewers can always see
786draft changes (even without having the `View Drafts` access right
787assigned).
788
789
David Pursehousebe7f4582012-12-12 11:21:29 +0900790[[category_publish_drafts]]
791Publish Drafts
792~~~~~~~~~~~~~~
793
794This category permits users to publish draft changes uploaded by other
795users.
796
797The change owner can always publish draft changes (even without having
798the `Publish Drafts` access right assigned).
799
800
801[[category_delete_drafts]]
802Delete Drafts
803~~~~~~~~~~~~~
804
805This category permits users to delete draft changes uploaded by other
806users.
807
808The change owner can always delete draft changes (even without having
809the `Delete Drafts` access right assigned).
810
811
David Pursehouse59aee362012-11-15 17:25:17 +0900812[[category_edit_topic_name]]
813Edit Topic Name
814~~~~~~~~~~~~~~~
815
816This category permits users to edit the topic name of a change that
817is uploaded for review.
818
819The change owner, branch owners, project owners, and site administrators
820can always edit the topic name (even without having the `Edit Topic Name`
821access right assigned).
822
823
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100824Examples of typical roles in a project
825--------------------------------------
826
827Below follows a set of typical roles on a server and which access
828rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900829general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100830brand new Gerrit instance.
831
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200832
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100833[[examples_contributor]]
834Contributor
835~~~~~~~~~~~
836
837This is the typical user on a public server. They are able to read
838your project and upload new changes to it. They are able to give
839feedback on other changes as well, but are unable to block or approve
840any changes.
841
842Suggested access rights to grant:
843
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800844* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
845* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
846* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100847
848
Fredrik Luthander654161c2012-01-31 14:42:36 +0100849[[examples_developer]]
850Developer
851~~~~~~~~~
852
853This is the typical core developer on a public server. They are able
854to read the project, upload changes to a branch. They are allowed to
855push merge commits to merge branches together. Also, they are allowed
856to forge author identity, thus handling commits belonging to others
857than themselves, effectively allowing them to transfer commits
858between different branches.
859
860They are furthermore able to code review and verify commits, and
861eventually submit them. If you have an automated CI system that
862builds all uploaded patch sets you might want to skip the
863verification rights for the developer and let the CI system do that
864exclusively.
865
866Suggested access rights to grant:
867
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800868* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
869* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
870* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
871* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
872* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-2' to '+2' for 'refs/heads/*'
873* link:config-labels.html#label_Verified[`Label: Verify`] with range '-1' to '+1' for 'refs/heads/*'
874* xref:category_submit[`Submit`]
Fredrik Luthander654161c2012-01-31 14:42:36 +0100875
876If the project is small or the developers are seasoned it might make
877sense to give them the freedom to push commits directly to a branch.
878
879Optional access rights to grant:
880
881* <<category_push,`Push`>> to 'refs/heads/*'
882* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
883
884
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100885[[examples_cisystem]]
886CI system
887~~~~~~~~~
888
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100889A typical Continuous Integration system should be able to download new changes
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100890to build and then leave a verdict somehow.
891
892As an example, the popular
893link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
894for Jenkins/Hudson can set labels at:
895
896* The start of a build
897* A successful build
898* An unstable build (tests fails)
899* A failed build
900
901Usually the range chosen for this verdict is the verify label. Depending on
902the size of your project and discipline of involved developers you might want
903to limit access right to the +1 `Verify` label to the CI system only. That
904way it's guaranteed that submitted commits always get built and pass tests
905successfully.
906
907If the build doesn't complete successfully the CI system can set the
908`Verify` label to -1. However that means that a failed build will block
909submit of the change even if someone else sets `Verify` +1. Depending on the
910project and how much the CI system can be trusted for accurate results, a
911blocking label might not be feasible. A recommended alternative is to set the
912label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900913shows a red label in the Gerrit UI. Optionally, to enable the possibility to
914deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100915possible to set `Code-review` +1 as well.
916
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200917If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100918submitted changes for upload to other branches under certain conditions. This
919is probably not the first step of what a project wants to automate however,
920and so the push right can be found under the optional section.
921
922Suggested access rights to grant, that won't block changes:
923
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800924* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
925* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '0' for 'refs/heads/*'
926* link:config-labels.html#label_Verified[`Label: Verify`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100927
928Optional access rights to grant:
929
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800930* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
931* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100932
933
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100934[[examples_integrator]]
935Integrator
936~~~~~~~~~~
937
938Integrators are like developers but with some additional rights granted due
939to their administrative role in a project. They can upload or push any commit
940with any committer email (not just their own) and they can also create new
941tags and branches.
942
943Suggested access rights to grant:
944
945* <<examples_developer,Developer rights>>
946* <<category_push,`Push`>> to 'refs/heads/*'
947* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
Fredrik Luthander404a2852012-10-10 08:51:22 +0200948* <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*'
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100949* <<category_create,`Create Reference`>> to 'refs/heads/*'
950* <<category_push_annotated,`Push Annotated Tag`>> to 'refs/tags/*'
951
952
Fredrik Luthander9c645362012-03-22 18:10:42 +0100953[[examples_project-owner]]
954Project owner
955~~~~~~~~~~~~~
956
957The project owner is almost like an integrator but with additional destructive
958power in the form of being able to delete branches. Optionally these users
959also have the power to configure access rights in gits assigned to them.
960
961[WARNING]
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100962These users should be really knowledgeable about git, for instance knowing why
Fredrik Luthander9c645362012-03-22 18:10:42 +0100963tags never should be removed from a server. This role is granted potentially
964destructive access rights and cleaning up after such a mishap could be time
965consuming!
966
967Suggested access rights to grant:
968
969* <<examples_integrator,Integrator rights>>
970* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
971
972Optional access right to grant:
973
974* <<category_owner,`Owner`>> in the gits they mostly work with.
975
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200976
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100977[[examples_administrator]]
978Administrator
979~~~~~~~~~~~~~
980
981The administrator role is the most powerful role known in the Gerrit universe.
982This role may grant itself (or others) any access right, and it already has
983all capabilities granted as well. By default the
984<<administrators,`Administrators` group>> is the group that has this role.
985
986Mandatory access rights:
987
988* <<capability_administrateServer,The `Administrate Server` capability>>
989
990Suggested access rights to grant:
991
992* <<examples_project-owner,Project owner rights>>
993
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200994
Sasa Zivkovd589f462013-02-12 14:27:09 +0100995Enforcing site wide access policies
996-----------------------------------
997
998By granting the <<category_owner,`Owner`>> access right on the `refs/*` to a
999group, Gerrit administrators can delegate the responsibility of maintaining
1000access rights for that project to that group.
1001
1002In a corporate deployment it is often necessary to enforce some access
1003policies. An example could be that no-one can update or delete a tag, not even
1004the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
1005purpose as project owners can grant themselves any access right they wish and,
1006thus, effectively override any inherited access rights from the
1007"`All-Projects`" or some other common parent project.
1008
1009What is needed is a mechanism to block a permission in a parent project so
1010that even project owners cannot allow a blocked permission in their child
1011project. Still, project owners should retain the possibility to manage all
1012non-blocked rules as they wish. This gives best of both worlds:
1013
1014* Gerrit administrators can concentrate on enforcing site wide policies
1015 and providing a meaningful set of default access permissions
1016* Project owners can manage access rights of their projects without a danger
1017 of violating a site wide policy
1018
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001019
Edwin Kempin60ab8532013-03-27 14:33:46 +01001020[[block]]
Sasa Zivkovd589f462013-02-12 14:27:09 +01001021'BLOCK' access rule
1022~~~~~~~~~~~~~~~~~~~
1023
1024The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK' rule cannot
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001025be overridden in the inheriting project. Any 'ALLOW' rule, from a different
1026access section or from an inheriting project, which conflicts with an
1027inherited 'BLOCK' rule will not be honored. Searching for 'BLOCK' rules, in
Sasa Zivkovd589f462013-02-12 14:27:09 +01001028the chain of parent projects, ignores the Exclusive flag that is normally
1029applied to access sections.
1030
1031A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1032force or not. A blocking force push rule blocks only force pushes, but
1033allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1034
1035It is also possible to block label ranges. To block a group 'X' from voting
1036'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1037range intact we would define:
1038
1039====
1040 [access "refs/heads/*"]
1041 label-Code-Review = block -2..+2 group X
1042====
1043
1044The interpretation of the 'min..max' range in case of a blocking rule is: block
1045every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1046means that the range '-1..+1' is not affected by this block.
1047
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001048'BLOCK' and 'ALLOW' rules in the same access section
1049~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1050
1051When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1052the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1053
1054====
1055 [access "refs/heads/*"]
1056 push = block group X
1057 push = group Y
1058====
1059
1060In this case a user which is a member of the group 'Y' will still be allowed to
1061push to 'refs/heads/*' even if it is a member of the group 'X'.
1062
1063NOTE: An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
1064inside the same access section of the same project. An 'ALLOW' rule in a
1065different access section of the same project or in any access section in an
1066inheriting project cannot override a 'BLOCK' rule.
1067
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001068
Sasa Zivkovd589f462013-02-12 14:27:09 +01001069Examples
1070~~~~~~~~
1071
1072The following examples show some possible use cases for the 'BLOCK' rules.
1073
1074Make sure no one can update or delete a tag
1075^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1076
1077This requirement is quite common in a corporate deployment where
1078reproducibility of a build must be guaranteed. To achieve that we block 'push'
1079permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1080
1081====
1082 [access "refs/tags/*"]
1083 push = block group Anonymous Users
1084====
1085
1086By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1087everyone as everyone is a member of that group. Note that the permission to
1088create a tag is still necessary. Assuming that only <<category_owner,project
1089owners>> are allowed to create tags, we would extend the example above:
1090
1091====
1092 [access "refs/tags/*"]
1093 push = block group Anonymous Users
1094 create = group Project Owners
1095 pushTag = group Project Owners
1096====
Fredrik Luthander9c645362012-03-22 18:10:42 +01001097
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001098
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001099Let only a dedicated group vote in a special category
1100^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1101
1102Assume there is a more restrictive process for submitting changes in stable
1103release branches which is manifested as a new voting category
1104'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1105group can vote in this category and that even project owners cannot approve
1106this category. We have to block everyone except the 'Release Engineers' to vote
1107in this category and, of course, allow 'Release Engineers' to vote in that
1108category. In the "`All-Projects`" we define the following rules:
1109
1110====
1111 [access "refs/heads/stable*"]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001112 label-Release-Process = block -1..+1 group Anonymous Users
1113 label-Release-Process = -1..+1 group Release Engineers
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001114====
1115
David Pursehouse8becc2a2013-04-23 18:51:04 +09001116[[global_capabilities]]
1117Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001118-------------------
1119
David Pursehouse8becc2a2013-04-23 18:51:04 +09001120The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001121the server can perform which usually affect the entire
1122server in some way. The administrators may delegate these
1123capabilities to trusted groups of users.
1124
1125Delegation of capabilities allows groups to be granted a subset of
1126administrative capabilities without being given complete
1127administrative control of the server. This makes it possible to
1128keep fewer users in the administrators group, even while spreading
1129much of the server administration burden out to more users.
1130
David Pursehouse8becc2a2013-04-23 18:51:04 +09001131Global capabilities are assigned to groups in the access rights settings
1132of the root project ("`All-Projects`").
1133
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001134Below you find a list of capabilities available:
1135
1136
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001137[[capability_accessDatabase]]
1138Access Database
1139~~~~~~~~~~~~~~~
1140
1141Allow users to access the database using the `gsql` command.
1142
1143
Fredrik Luthander426885f2012-02-13 09:56:57 +01001144[[capability_administrateServer]]
1145Administrate Server
1146~~~~~~~~~~~~~~~~~~~
1147
1148This is in effect the owner and administrator role of the Gerrit
1149instance. Any members of a group granted this capability will be
1150able to grant any access right to any group. They will also have all
1151capabilities granted to them automatically.
1152
1153
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001154[[capability_createAccount]]
1155Create Account
1156~~~~~~~~~~~~~~
1157
Fredrik Luthander79d38152012-03-13 09:52:22 +01001158Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001159This capability allows the granted group members to create non-interactive
1160service accounts. These service accounts are generally used for automation
1161and made to be members of the
1162link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1163
1164
Fredrik Luthander79d38152012-03-13 09:52:22 +01001165[[capability_createGroup]]
1166Create Group
1167~~~~~~~~~~~~
1168
1169Allow group creation. Groups are used to grant users access to different
1170actions in projects. This capability allows the granted group members to
1171either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1172
1173
1174[[capability_createProject]]
1175Create Project
1176~~~~~~~~~~~~~~
1177
1178Allow project creation. This capability allows the granted group to
1179either link:cmd-create-project.html[create new git projects via ssh]
1180or via the web UI.
1181
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001182
Sasa Zivkov812f4892012-06-21 16:25:21 +02001183[[capability_emailReviewers]]
1184Email Reviewers
1185~~~~~~~~~~~~~~~
1186
1187Allow or deny sending email to change reviewers and watchers. This can be used
1188to deny build bots from emailing reviewers and people who watch the change.
1189Instead, only the authors of the change and those who starred it will be
1190emailed. The allow rules are evaluated before deny rules, however the default
1191is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001192
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001193
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001194[[capability_flushCaches]]
1195Flush Caches
1196~~~~~~~~~~~~
1197
Fredrik Luthander48603002012-03-21 18:17:17 +01001198Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001199group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1200
1201[NOTE]
1202This capability doesn't imply permissions to the show-caches command. For that
1203you need the <<capability_viewCaches,view caches capability>>.
1204
1205
David Pursehousecbd22ac2013-06-09 08:03:14 +09001206[[capability_generateHttpPassword]]
1207Generate HTTP Password
1208~~~~~~~~~~~~~~~~~~~~~~
1209
1210Allow the user to generate HTTP passwords for other users. Typically this would
1211be assigned to a non-interactive users group.
1212
1213
Fredrik Luthander46843022012-03-13 16:11:02 +01001214[[capability_kill]]
1215Kill Task
1216~~~~~~~~~
1217
1218Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1219kill command ends tasks that currently occupy the Gerrit server, usually
1220a replication task or a user initiated task such as an upload-pack or
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001221receive-pack.
Fredrik Luthander46843022012-03-13 16:11:02 +01001222
1223
1224[[capability_priority]]
1225Priority
1226~~~~~~~~
1227
1228This capability allows users to use
1229link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1230link:access-control.html#non-interactive_users['Non-Interactive Users'].
1231It's a binary value in that granted users either have access to the thread
1232pool, or they don't.
1233
1234There are three modes for this capability and they're listed by rising
1235priority:
1236
1237No capability configured.::
1238The user isn't a member of a group with any priority capability granted. By
1239default the user is then in the 'INTERACTIVE' thread pool.
1240
1241'BATCH'::
1242If there's a thread pool configured for 'Non-Interactive Users' and a user is
1243granted the priority capability with the 'BATCH' mode selected, the user ends
1244up in the separate batch user thread pool. This is true unless the user is
1245also granted the below 'INTERACTIVE' option.
1246
1247'INTERACTIVE'::
1248If a user is granted the priority capability with the 'INTERACTIVE' option,
1249regardless if they also have the 'BATCH' option or not, they are in the
1250'INTERACTIVE' thread pool.
1251
1252
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001253[[capability_queryLimit]]
1254Query Limit
1255~~~~~~~~~~~
1256
1257Allow site administrators to configure the query limit for users to
1258be above the default hard-coded value of 500. Administrators can add
1259a global block to `All-Projects` with group(s) that
1260should have different limits:
1261
1262When applying a query limit to a user the largest value granted by
1263any of their groups is used.
1264
1265This limit applies not only to the link:cmd-query.html[`gerrit query`]
1266command, but also to the web UI results pagination size.
1267
1268
Edwin Kempin619169b2012-02-09 15:47:52 +01001269[[capability_runGC]]
1270Run Garbage Collection
1271~~~~~~~~~~~~~~~~~~~~~~
1272
1273Allow users to run the Git garbage collection for the repositories of
1274all projects.
1275
1276
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001277[[capability_startReplication]]
1278Start Replication
1279~~~~~~~~~~~~~~~~~
1280
Shawn O. Pearce7d2cb042012-05-10 19:12:09 -07001281Allow access to execute `replication start` command, if the
1282replication plugin is installed on the server.
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001283
1284
Ed Bartoshd168b812013-04-13 20:15:58 +03001285[[capability_streamEvents]]
1286Stream Events
1287~~~~~~~~~~~~~
1288
1289Allow performing streaming of Gerrit events. This capability
1290allows the granted group to
1291link:cmd-stream-events.html[stream Gerrit events via ssh].
1292
1293
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001294[[capability_viewCaches]]
1295View Caches
1296~~~~~~~~~~~
1297
Fredrik Luthander48603002012-03-21 18:17:17 +01001298Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001299the granted group to
1300link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1301
1302
Fredrik Luthander48603002012-03-21 18:17:17 +01001303[[capability_viewConnections]]
1304View Connections
1305~~~~~~~~~~~~~~~~
1306
1307Allow querying for status of Gerrit's current client connections. This
1308capability allows the granted group to
1309link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1310
1311
1312[[capability_viewQueue]]
1313View Queue
1314~~~~~~~~~~
1315
1316Allow querying for status of Gerrit's internal task queue. This capability
1317allows the granted group to
1318link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1319
1320
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001321GERRIT
1322------
1323Part of link:index.html[Gerrit Code Review]