blob: 8ff2eb623805ac047ce340233da398e185284697 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Access Controls
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08002
3Access controls in Gerrit are group based. Every user account is a
4member of one or more groups, and access and privileges are granted
Matt Fischer620255a2011-03-22 14:28:23 -05005to those groups. Access rights cannot be granted to individual
6users.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -08007
8
Edwin Kempin4bf01962014-04-16 16:47:10 +02009[[system_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080010== System Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080011
Anita Kuno178f64b2014-04-22 18:52:28 -040012Gerrit comes with the following system groups:
Khai Do4245e6f2013-10-11 18:14:31 +020013
14* Administrators
15* Anonymous Users
16* Change Owner
17* Non-Interactive Users
18* Project Owners
19* Registered Users
20
21The system groups are assigned special access and membership management
22privileges. The identity of these groups is set in the `system_config`
23table within the database, so the groups can be renamed after installation
24if desired.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080025
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020026
Edwin Kempin913eab12011-05-06 08:18:24 +020027[[administrators]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080028=== Administrators
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080029
30This is the Gerrit "root" identity.
31
32Users in the 'Administrators' group can perform any action under
33the Admin menu, to any group or project, without further validation
David Pursehouse221d4f62012-06-08 17:38:08 +090034or any other access controls. In most installations only those
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080035users who have direct filesystem and database access would be
36placed into this group.
37
38Membership in the 'Administrators' group does not imply any other
39access rights. Administrators do not automatically get code review
40approval or submit rights in projects. This is a feature designed
Nico Sallembienee6eaf02010-02-01 13:24:49 -080041to permit administrative users to otherwise access Gerrit as any
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080042other normal user would, without needing two different accounts.
43
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020044
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010045[[anonymous_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080046=== Anonymous Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080047
48All users are automatically a member of this group. Users who are
49not signed in are a member of only this group, and no others.
50
51Any access rights assigned to this group are inherited by all users.
52
53Administrators and project owners can grant access rights to this
54group in order to permit anonymous users to view project changes,
55without requiring sign in first. Currently it is only worthwhile
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +010056to grant `Read` access to this group as Gerrit requires an account
Shawn O. Pearce4b122b82009-02-18 18:22:14 -080057identity for all other operations.
58
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020059
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010060[[non-interactive_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080061=== Non-Interactive Users
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010062
63This is an internal user group, members of this group are not expected
Gustaf Lundha28a1d22013-05-08 15:05:12 +010064to perform interactive operations on the Gerrit web front-end.
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010065
66However, sometimes such a user may need a separate thread pool in
67order to prevent it from grabbing threads from the interactive users.
68
69These users live in a second thread pool, which separates operations
70made by the non-interactive users from the ones made by the interactive
71users. This ensures that the interactive users can keep working when
72resources are tight.
73
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020074
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010075[[project_owners]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080076=== Project Owners
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010077
78Access rights assigned to this group are always evaluated within the
79context of a project to which the access rights apply. These rights
80therefore apply to all the users who are owners of this project.
81
82By assigning access rights to this group on a parent project Gerrit
83administrators can define a set of default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010084<<category_owner,project owners>>. Child projects inherit these
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010085access rights where they are resolved to the users that own the child
86project. Having default access rights for
Fredrik Luthanderea13ca52011-12-29 11:36:48 +010087<<category_owner,project owners>> assigned on a parent project may
Fredrik Luthander8fa3d262011-11-07 17:04:01 +010088avoid the need to initially configure access rights for
89newly created child projects.
90
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +020091
Khai Do4245e6f2013-10-11 18:14:31 +020092[[change_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080093=== Change Owner
Khai Do4245e6f2013-10-11 18:14:31 +020094
95Access rights assigned to this group are always evaluated within the
96context of a change to which the access rights apply. These rights
97therefore apply to the user who is the owner of this change.
98
99It is typical to assign a label to this group, allowing the change
100owner to vote on his change, but not actually cause it to become
101approved or rejected.
102
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100103[[registered_users]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800104=== Registered Users
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800105
106All signed-in users are automatically a member of this group (and
Fredrik Luthander54abc352012-01-20 16:18:41 +0100107also <<anonymous_users,'Anonymous Users'>>, see above).
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800108
109Any access rights assigned to this group are inherited by all
110users as soon as they sign-in to Gerrit. If OpenID authentication
111is being employed, moving from only 'Anonymous Users' into this
112group is very easy. Caution should be taken when assigning any
113permissions to this group.
114
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800115It is typical to assign `Code-Review -1..+1` to this group,
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800116allowing signed-in users to vote on a change, but not actually
117cause it to become approved or rejected.
118
119Registered users are always permitted to make and publish comments
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100120on any change in any project they have `Read` access to.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800121
122
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800123== Account Groups
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800124
125Account groups contain a list of zero or more user account members,
126added individually by a group owner. Any user account listed as
127a group member is given any access rights granted to the group.
128
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800129Every group has one other group designated as its owner. Users who
130are members of the owner group can:
131
Fredrik Luthander8fa3d262011-11-07 17:04:01 +0100132* Add users and other groups to this group
133* Remove users and other groups from this group
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800134* Change the name of this group
135* Change the description of this group
136* Change the owner of this group, to another group
137
138It is permissible for a group to own itself, allowing the group
139members to directly manage who their peers are.
140
141Newly created groups are automatically created as owning themselves,
142with the creating user as the only member. This permits the group
143creator to add additional members, and change the owner to another
144group if desired.
145
146It is somewhat common to create two groups at the same time,
147for example `Foo` and `Foo-admin`, where the latter group
148`Foo-admin` owns both itself and also group `Foo`. Users who
149are members of `Foo-admin` can thus control the membership of
150`Foo`, without actually having the access rights granted to `Foo`.
151This configuration can help prevent accidental submits when the
152members of `Foo` have submit rights on a project, and the members of
153`Foo-admin` typically do not need to have such rights.
154
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200155
Thanh Ha6eed43f2013-04-11 21:03:55 -0400156[[ldap_groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800157== LDAP Groups
Thanh Ha6eed43f2013-04-11 21:03:55 -0400158
159LDAP groups are Account Groups that are maintained inside of your
160LDAP instance. If you are using LDAP to manage your groups they will
161not appear in the Groups list. However you can use them just like
162regular Account Groups by prefixing your group with "ldap/" in the
163Access Control for a project. For example "ldap/foo-project" will
164add the LDAP "foo-project" group to the access list.
165
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800166
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800167== Project Access Control Lists
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800168
lincolnfa7bdd32010-04-22 14:23:05 -0300169A system wide access control list affecting all projects is stored in
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700170project "`All-Projects`". This inheritance can be configured
lincolnfa7bdd32010-04-22 14:23:05 -0300171through link:cmd-set-project-parent.html[gerrit set-project-parent].
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800172
173Per-project access control lists are also supported.
174
175Users are permitted to use the maximum range granted to any of their
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800176groups on a label. For example, a user is a member of `Foo Leads`, and
177the following ACLs are granted on a project:
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800178
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100179[options="header"]
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800180|===================================================
181|Group |Reference Name |Label |Range
182|Anonymous Users |refs/heads/* |Code-Review|-1..+1
183|Registered Users|refs/heads/* |Code-Review|-1..+2
184|Foo Leads |refs/heads/* |Code-Review|-2..0
185|===================================================
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800186
187Then the effective range permitted to be used by the user is
188`-2..+2`, as the user is a member of all three groups (see above
189about the system groups) and the maximum range is chosen (so the
190lowest value granted to any group, and the highest value granted
191to any group).
192
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800193Reference-level access control is also possible.
194
195Permissions can be set on a single reference name to match one
196branch (e.g. `refs/heads/master`), or on a reference namespace
Edwin Kempina2bf0832011-09-08 14:23:30 +0200197(e.g. `refs/heads/*`) to match any branch starting with that
198prefix. So a permission with `refs/heads/*` will match
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800199`refs/heads/master` and `refs/heads/experimental`, etc.
200
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700201Reference names can also be described with a regular expression
Edwin Kempina2bf0832011-09-08 14:23:30 +0200202by prefixing the reference name with `^`. For example
203`^refs/heads/[a-z]{1,8}` matches all lower case branch names
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700204between 1 and 8 characters long. Within a regular expression `.`
205is a wildcard matching any character, but may be escaped as `\.`.
Magnus Bäcke5611832011-02-02 08:57:15 +0100206The link:http://www.brics.dk/automaton/[dk.brics.automaton library]
207is used for evaluation of regular expression access control
208rules. See the library documentation for details on this
209particular regular expression flavor.
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700210
211References can have the current user name automatically included,
212creating dynamic access controls that change to match the currently
213logged in user. For example to provide a personal sandbox space
Edwin Kempina2bf0832011-09-08 14:23:30 +0200214to all developers, `refs/heads/sandbox/${username}/*` allowing
Shawn O. Pearce6d6d4512010-07-15 11:42:34 -0700215the user 'joe' to use 'refs/heads/sandbox/joe/foo'.
216
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800217When evaluating a reference-level access right, Gerrit will use
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700218the full set of access rights to determine if the user
219is allowed to perform a given action. For example, if a user is a
220member of `Foo Leads`, they are reviewing a change destined for
221the `refs/heads/qa` branch, and the following ACLs are granted
222on the project:
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800223
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100224[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100225|===============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800226|Group |Reference Name|Label |Range |Exclusive
227|Registered Users |refs/heads/* |Code-Review| -1..+1 |
228|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
229|QA Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100230|===============================================================
Nico Sallembienee6eaf02010-02-01 13:24:49 -0800231
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700232Then the effective range permitted to be used by the user is
233`-2..+2`, as the user's membership of `Foo Leads` effectively grant
234them access to the entire reference space, thanks to the wildcard.
235
236Gerrit also supports exclusive reference-level access control.
237
238It is possible to configure Gerrit to grant an exclusive ref level
239access control so that only users of a specific group can perform
Fredrik Luthander54abc352012-01-20 16:18:41 +0100240an operation on a project/reference pair. This is done by ticking
241the exclusive flag when setting the permission for the
242`refs/heads/qa` branch.
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700243
244For example, if a user who is a member of `Foo Leads` tries to
245review a change destined for branch `refs/heads/qa` in a project,
246and the following ACLs are granted:
247
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100248[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100249|==============================================================
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800250|Group |Reference Name|Label |Range |Exclusive
251|Registered Users|refs/heads/* |Code-Review| -1..+1 |
252|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
253|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
Fredrik Luthander54abc352012-01-20 16:18:41 +0100254|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700255
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800256Then this user will not have `Code-Review` rights on that change,
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700257since there is an exclusive access right in place for the
258`refs/heads/qa` branch. This allows locking down access for a
259particular branch to a limited set of users, bypassing inherited
260rights and wildcards.
261
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800262In order to grant the ability to `Code-Review` to the members of
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700263`Foo Leads`, in `refs/heads/qa` then the following access rights
264would be needed:
265
Karsten Dambekalnsa7f72a22011-03-25 14:21:59 +0100266[options="header"]
Fredrik Luthander54abc352012-01-20 16:18:41 +0100267|==============================================================
268|Group |Reference Name|Category |Range |Exclusive
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800269|Registered Users|refs/heads/* |Code-Review| -1..+1 |
270|Foo Leads |refs/heads/* |Code-Review| -2..+2 |
271|QA Leads |refs/heads/qa |Code-Review| -2..+2 |X
272|Foo Leads |refs/heads/qa |Code-Review| -2..+2 |
Fredrik Luthander54abc352012-01-20 16:18:41 +0100273|==============================================================
Nico Sallembiena78a37c2010-05-04 11:49:12 -0700274
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200275
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800276=== OpenID Authentication
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800277
278If the Gerrit instance is configured to use OpenID authentication,
279an account's effective group membership will be restricted to only
280the `Anonymous Users` and `Registered Users` groups, unless *all*
281of its OpenID identities match one or more of the patterns listed
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700282in the `auth.trustedOpenID` list from `gerrit.config`.
Shawn O. Pearcea2299662009-02-25 14:34:40 -0800283
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200284
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800285=== All Projects
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800286
Shawn O. Pearcea0631822011-06-14 11:18:18 -0700287Any access right granted to a group within `All-Projects`
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800288is automatically inherited by every other project in the same
289Gerrit instance. These rights can be seen, but not modified,
290in any other project's `Access` administration tab.
291
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100292Only members of the groups with the `Administrate Server` capability
293may edit the access control list for `All-Projects`. By default this
294capability is given to the group `Administrators`, but can be given
295to more groups.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700296
297Ownership of this project cannot be delegated to another group.
298This restriction is by design. Granting ownership to another
299group gives nearly the same level of access as membership in
300`Administrators` does, as group members would be able to alter
Fredrik Luthanderd9960882011-11-08 01:42:19 +0100301permissions for every managed project including global capabilities.
Shawn O. Pearcee2c2a222010-05-11 13:43:45 -0700302
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200303
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800304=== Per-Project
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800305
Fredrik Luthanderda867882011-12-21 18:28:40 +0100306The per-project ACL is evaluated before the global `All-Projects` ACL,
307permitting some limited override capability to project owners. This
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100308behavior is generally only useful on the `Read` category when
309granting 'DENY' within a specific project to deny a group access.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800310
311
Fredrik Luthander98030252012-04-13 11:01:22 +0200312[[references]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800313== Special and magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200314
315The reference namespaces used in git are generally two, one for branches and
316one for tags:
317
318* +refs/heads/*+
319* +refs/tags/*+
320
321However, every reference under +refs/*+ is really available, and in Gerrit this
322opportunity for giving other refs a special meaning is used. In Gerrit they
323are sometimes used as magic/virtual references that give the push to Gerrit a
324special meaning.
325
326
327[[references_special]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800328=== Special references
Fredrik Luthander98030252012-04-13 11:01:22 +0200329
330The special references have content that's either generated by Gerrit or
331contains important project configuration that Gerrit needs. When making
332changes to these references, Gerrit will take extra precautions to verify the
333contents compatibility at upload time.
334
335
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800336==== refs/changes/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200337
338Under this namespace each uploaded patch set for every change gets a static
339reference in their git. The format is convenient but still intended to scale to
340hundreds of thousands of patch sets. To access a given patch set you will
341need the change number and patch set number.
342
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800343--
Fredrik Luthander98030252012-04-13 11:01:22 +0200344'refs/changes/'<last two digits of change number>/
345 <change number>/
346 <patch set number>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800347--
Fredrik Luthander98030252012-04-13 11:01:22 +0200348
349You can also find these static references linked on the page of each change.
350
351
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800352==== refs/meta/config
Fredrik Luthander98030252012-04-13 11:01:22 +0200353
Matt Baker3a40c6d2013-11-26 21:01:17 -0700354This is where the Gerrit configuration of each project resides. This
Fredrik Luthander98030252012-04-13 11:01:22 +0200355branch contains several files of importance: +project.config+, +groups+ and
Matt Baker3a40c6d2013-11-26 21:01:17 -0700356+rules.pl+. Together they control access and behavior during the change
Fredrik Luthander98030252012-04-13 11:01:22 +0200357review process.
358
359
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800360==== refs/meta/dashboards/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200361
362There's a dedicated page where you can read more about
363link:user-dashboards.html[User Dashboards].
364
365
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800366==== refs/notes/review
Fredrik Luthander98030252012-04-13 11:01:22 +0200367
368Autogenerated copy of review notes for all changes in the git. Each log entry
369on the refs/notes/review branch also references the patch set on which the
370review is made. This functionality is provided by the review-notes plugin.
371
372
373[[references_magic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800374=== Magic references
Fredrik Luthander98030252012-04-13 11:01:22 +0200375
376These are references with added functionality to them compared to a regular
377git push operation.
378
Edwin Kempin4bf01962014-04-16 16:47:10 +0200379[[refs_for]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800380==== refs/for/<branch ref>
Fredrik Luthander98030252012-04-13 11:01:22 +0200381
382Most prominent is the `refs/for/<branch ref>` reference which is the reference
383upon which we build the code review intercept before submitting a commit to
384the branch it's uploaded to.
385
386Further documentation on how to push can be found on the
387link:user-upload.html#push_create[Upload changes] page.
388
389
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800390==== refs/publish/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200391
392`refs/publish/*` is an alternative name to `refs/for/*` when pushing new changes
393and patch sets.
394
395
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800396==== refs/drafts/*
Fredrik Luthander98030252012-04-13 11:01:22 +0200397
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
David Ostrovsky07ddca52014-01-21 22:51:47 +0100404To block push permission to `refs/drafts/*` the following permission rule can
405be configured:
406
407====
408 [access "refs/drafts/*"]
409 push = block group Anonymous Users
410====
411
Fredrik Luthander98030252012-04-13 11:01:22 +0200412
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200413[[access_categories]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800414== Access Categories
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800415
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200416Gerrit has several permission categories that can be granted to groups
417within projects, enabling functionality for that group's members.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800418
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200419
Fredrik Luthander69236de2013-05-09 14:50:39 +0200420
Chad Horohoe029c85a2012-06-07 16:10:14 -0400421[[category_abandon]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800422=== Abandon
Chad Horohoe029c85a2012-06-07 16:10:14 -0400423
424This category controls whether users are allowed to abandon changes
425to projects in Gerrit. It can give permission to abandon a specific
426change to a given ref.
427
David Pursehousec795eb12013-07-05 14:20:28 +0900428This also grants the permission to restore a change if the user also
429has link:#category_push[push permission] on the change's destination
430ref.
Chad Horohoe35ced0a2012-06-27 19:20:34 -0400431
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200432
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100433[[category_create]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800434=== Create Reference
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100435
436The create reference category controls whether it is possible to
437create new references, branches or tags. This implies that the
438reference must not already exist, it's not a destructive permission
David Pursehouse221d4f62012-06-08 17:38:08 +0900439in that you can't overwrite or remove any previously existing
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100440references (and also discard any commits in the process).
441
442It's probably most common to either permit the creation of a single
443branch in many gits (by granting permission on a parent project), or
444to grant this permission to a name pattern of branches.
445
446This permission is often given in conjunction with regular push
447branch permissions, allowing the holder of both to create new branches
448as well as bypass review for new commits on that branch.
449
David Pursehouse221d4f62012-06-08 17:38:08 +0900450To push lightweight (non-annotated) tags, grant
Fredrik Luthandere9eeeea2011-12-08 16:45:32 +0100451`Create Reference` for reference name `refs/tags/*`, as lightweight
452tags are implemented just like branches in Git.
453
454For example, to grant the possibility to create new branches under the
455namespace `foo`, you have to grant this permission on
456`refs/heads/foo/*` for the group that should have it.
457Finally, if you plan to grant each user a personal namespace in
458where they are free to create as many branches as they wish, you
459should grant the create reference permission so it's possible
460to create new branches. This is done by using the special
461`${username}` keyword in the reference pattern, e.g.
462`refs/heads/sandbox/${username}/*`. If you do, it's also recommended
463you grant the users the push force permission to be able to clean up
464stale branches.
465
466
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100467[[category_forge_author]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800468=== Forge Author
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100469
470Normally Gerrit requires the author and the committer identity
471lines in a Git commit object (or tagger line in an annotated tag) to
472match one of the registered email addresses of the uploading user.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100473This permission allows users to bypass parts of that validation, which
474may be necessary when mirroring changes from an upstream project.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100475
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100476Permits the use of an unverified author line in commit objects.
477This can be useful when applying patches received by email from
4783rd parties, when cherry-picking changes written by others across
479branches, or when amending someone else's commit to fix up a minor
480problem before submitting.
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100481
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100482By default this is granted to `Registered Users` in all projects,
483but a site administrator may disable it if verified authorship
484is required.
485
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100486
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100487[[category_forge_committer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800488=== Forge Committer
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100489
490Normally Gerrit requires the author and the committer identity
491lines in a Git commit object (or tagger line in an annotated tag) to
492match one of the registered email addresses of the uploading user.
493This permission allows users to bypass parts of that validation, which
494may be necessary when mirroring changes from an upstream project.
495
496Allows the use of an unverified committer line in commit objects, or an
497unverified tagger line in annotated tag objects. Typically this is only
498required when mirroring commits from an upstream project repository.
499
500
501[[category_forge_server]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800502=== Forge Server
Fredrik Luthander8f430f12011-12-27 13:40:43 +0100503
504Normally Gerrit requires the author and the committer identity
505lines in a Git commit object (or tagger line in an annotated tag) to
506match one of the registered email addresses of the uploading user.
507This permission allows users to bypass parts of that validation, which
508may be necessary when mirroring changes from an upstream project.
509
510Allows the use of the server's own name and email on the committer
511line of a new commit object. This should only be necessary when force
512pushing a commit history which has been rewritten by 'git filter-branch'
513and that contains merge commits previously created by this Gerrit Code
514Review server.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100515
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100516
517[[category_owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800518=== Owner
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100519
520The `Owner` category controls which groups can modify the project's
521configuration. Users who are members of an owner group can:
522
523* Change the project description
Fredrik Luthander9c949382014-03-22 09:19:45 -0700524* Create a branch via the ssh command link:cmd-create-branch.html['create-branch']
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530525* Create/delete a branch through the web UI
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100526* Grant/revoke any access rights, including `Owner`
527
Mani Chandel7ec4ac72013-12-10 14:50:33 +0530528To get SSH branch access project owners must grant an access right to a group
529they are a member of, just like for any other user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100530
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]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800541=== Push
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]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800552==== Direct Push
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100553
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100554Any existing branch can be fast-forwarded to a new commit.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200555Creation of new branches is controlled by the
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100556link:access-control.html#category_create['Create Reference']
557category. Deletion of existing branches is rejected. This is the
558safest mode as commits cannot be discarded.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100559
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100560* Force option
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100561+
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100562Allows an existing branch to be deleted. Since a force push is
563effectively a delete immediately followed by a create, but performed
564atomically on the server and logged, this option also permits forced
565push updates to branches. Enabling this option allows existing commits
566to be discarded from a project history.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100567
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100568The push category is primarily useful for projects that only want to
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100569take advantage of Gerrit's access control features and do not need
570its code review functionality. Projects that need to require code
571reviews should not grant this category.
572
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100573
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100574[[category_push_review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800575==== Upload To Code Review
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100576
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100577The `Push` access right granted on the namespace
578`refs/for/refs/heads/BRANCH` permits the user to upload a non-merge
579commit to the project's `refs/for/BRANCH` namespace, creating a new
580change for code review.
581
582A user must be able to clone or fetch the project in order to create
583a new commit on their local system, so in practice they must also
584have the `Read` access granted to upload a change.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100585
586For an open source, public Gerrit installation, it is common to
Fredrik Luthanderea13ca52011-12-29 11:36:48 +0100587grant `Read` and `Push` for `refs/for/refs/heads/*`
588to `Registered Users` in the `All-Projects` ACL. For more
589private installations, its common to simply grant `Read` and
590`Push` for `refs/for/refs/heads/*` to all users of a project.
591
592* Force option
593+
594The force option has no function when granted to a branch in the
595`refs/for/refs/heads/*` namespace.
596
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100597
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100598[[category_push_merge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800599=== Push Merge Commits
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100600
Magnus Bäck282c1022012-04-18 15:39:17 -0400601The `Push Merge Commit` access right permits the user to upload merge
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100602commits. It's an add-on to the <<category_push,Push>> access right, and
Magnus Bäck282c1022012-04-18 15:39:17 -0400603so it won't be sufficient with only `Push Merge Commit` granted for a
604push to happen. Some projects wish to restrict merges to being created
605by Gerrit. By granting `Push` without `Push Merge Commit`, the only
Edwin Kempinaef5d6e2012-01-24 09:04:54 +0100606merges that enter the system will be those created by Gerrit.
Fredrik Luthanderbf568572012-01-18 11:17:00 +0100607
Jonathan Niederdaf8bd42013-10-01 15:06:14 -0700608The reference name connected to a `Push Merge Commit` entry must always
609be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`.
610This applies even for an entry that complements a `Push` entry for
611`refs/heads/BRANCH` that allows direct pushes of non-merge commits, and
612the intention of the `Push Merge Commit` entry is to allow direct pushes
613of merge commits.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100614
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200615
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100616[[category_push_annotated]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800617=== Push Annotated Tag
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100618
David Pursehouse690cebe2012-12-12 19:22:45 +0900619This category permits users to push an annotated tag object into the
620project's repository. Typically this would be done with a command line
621such as:
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100622
623====
624 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
625====
626
David Pursehouse690cebe2012-12-12 19:22:45 +0900627Or:
628
629====
630 git push https://HOST/PROJECT tag v1.0
631====
632
David Pursehouseb429ce12012-12-12 11:04:40 +0900633Tags must be annotated (created with `git tag -a`), should exist in
634the `refs/tags/` namespace, and should be new.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100635
636This category is intended to be used to publish tags when a project
637reaches a stable release point worth remembering in history.
638
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100639It allows for a new annotated (unsigned) tag to be created. The
640tagger email address must be verified for the current user.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100641
642To push tags created by users other than the current user (such
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100643as tags mirrored from an upstream project), `Forge Committer Identity`
644must be also granted in addition to `Push Annotated Tag`.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100645
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100646To push lightweight (non annotated) tags, grant
647<<category_create,`Create Reference`>> for reference name
648`refs/tags/*`, as lightweight tags are implemented just like
649branches in Git.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100650
Fredrik Luthanderd7749862012-01-20 07:29:43 +0100651To delete or overwrite an existing tag, grant `Push` with the force
652option enabled for reference name `refs/tags/*`, as deleting a tag
653requires the same permission as deleting a branch.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100654
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100655
David Pursehouseb429ce12012-12-12 11:04:40 +0900656[[category_push_signed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800657=== Push Signed Tag
David Pursehouseb429ce12012-12-12 11:04:40 +0900658
David Pursehouse690cebe2012-12-12 19:22:45 +0900659This category permits users to push a PGP signed tag object into the
660project's repository. Typically this would be done with a command
661line such as:
David Pursehouseb429ce12012-12-12 11:04:40 +0900662
663====
664 git push ssh://USER@HOST:PORT/PROJECT tag v1.0
665====
666
David Pursehouse690cebe2012-12-12 19:22:45 +0900667Or:
668
669====
670 git push https://HOST/PROJECT tag v1.0
671====
672
David Pursehouseb429ce12012-12-12 11:04:40 +0900673Tags must be signed (created with `git tag -s`), should exist in the
674`refs/tags/` namespace, and should be new.
675
676
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100677[[category_read]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800678=== Read
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100679
680The `Read` category controls visibility to the project's
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100681changes, comments, code diffs, and Git access over SSH or HTTP.
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100682A user must have this access granted in order to see a project, its
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100683changes, or any of its data.
684
685This category has a special behavior, where the per-project ACL is
686evaluated before the global all projects ACL. If the per-project
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100687ACL has granted `Read` with 'DENY', and does not otherwise grant
688`Read` with 'ALLOW', then a `Read` in the all projects ACL
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100689is ignored. This behavior is useful to hide a handful of projects
690on an otherwise public server.
691
692For an open source, public Gerrit installation it is common to grant
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100693`Read` to `Anonymous Users` in the `All-Projects` ACL, enabling
694casual browsing of any project's changes, as well as fetching any
695project's repository over SSH or HTTP. New projects can be
696temporarily hidden from public view by granting `Read` with 'DENY'
697to `Anonymous Users` and granting `Read` to the project owner's
698group within the per-project ACL.
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100699
700For a private Gerrit installation using a trusted HTTP authentication
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100701source, granting `Read` to `Registered Users` may be more
Fredrik Luthanderdb7679a2011-11-03 08:52:56 +0100702typical, enabling read access only to those users who have been
703able to authenticate through the HTTP access controls. This may
704be suitable in a corporate deployment if the HTTP access control
705is already restricted to the correct set of users.
706
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100707
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200708[[category_rebase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800709=== Rebase
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200710
711This category permits users to rebase changes via the web UI by pushing
712the `Rebase Change` button.
713
714The change owner and submitters can always rebase changes in the web UI
715(even without having the `Rebase` access right assigned).
716
717Users without this access right who are able to upload new patch sets
718can still do the rebase locally and upload the rebased commit as a new
719patch set.
720
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200721
Chad Horohoec626f3c2012-09-13 11:04:20 -0700722[[category_remove_reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800723=== Remove Reviewer
Chad Horohoec626f3c2012-09-13 11:04:20 -0700724
725This category permits users to remove other users from the list of
726reviewers on a change.
727
728The change owner, project owner and site administrator can always
729remove reviewers (even without having the `Remove Reviewer` access
730right assigned).
731
732Users without this access right can only remove themselves from the
733reviewer list on a change.
734
Edwin Kempinfd330fc2012-05-09 21:09:55 +0200735
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200736[[category_review_labels]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800737=== Review Labels
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200738
739For every configured label `My-Name` in the project, there is a
740corresponding permission `label-My-Name` with a range corresponding to
Shawn Pearce9d783122013-06-11 18:18:03 -0700741the defined values. There is also a corresponding `labelAs-My-Name`
742permission that enables editing another user's label.
Fredrik Luthander5ccf2e42013-05-08 01:06:25 +0200743
744Gerrit comes pre-configured with a default 'Code-Review' label that can
745be granted to groups within projects, enabling functionality for that
746group's members. link:config-labels.html[Custom labels] may also be
747defined globally or on a per-project basis.
748
749
Fredrik Luthander5e1b51b2012-01-20 13:06:06 +0100750[[category_submit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800751=== Submit
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800752
753This category permits users to push the `Submit Patch Set n` button
754on the web UI.
755
756Submitting a change causes it to be merged into the destination
757branch as soon as possible, making it a permanent part of the
David Pursehouse22bd6f92014-02-20 21:11:01 +0900758project's history.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800759
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800760In order to submit, all labels (such as `Verified` and `Code-Review`,
761above) must enable submit, and also must not block it. See above for
762details on each label.
Shawn O. Pearce4b122b82009-02-18 18:22:14 -0800763
Edwin Kempinbfa06212013-04-04 16:06:39 +0200764To link:user-upload.html#auto_merge[immediately submit a change on push]
765the caller needs to have the Submit permission on `refs/for/<ref>`
766(e.g. on `refs/for/refs/heads/master`).
767
David Pursehouse22bd6f92014-02-20 21:11:01 +0900768[[category_submit_on_behalf_of]]
769=== Submit (On Behalf Of)
770
771This category permits users who have also been granted the `Submit`
772permission to submit changes on behalf of another user.
773
774Note that this permission is named `submitAs` in the `project.config`
775file.
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100776
David Pursehouse5ae73002012-11-01 15:22:26 +0900777[[category_view_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800778=== View Drafts
David Pursehouse5ae73002012-11-01 15:22:26 +0900779
780This category permits users to view draft changes uploaded by other
781users.
782
783The change owner and any explicitly added reviewers can always see
784draft changes (even without having the `View Drafts` access right
785assigned).
786
787
David Pursehousebe7f4582012-12-12 11:21:29 +0900788[[category_publish_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800789=== Publish Drafts
David Pursehousebe7f4582012-12-12 11:21:29 +0900790
791This category permits users to publish draft changes uploaded by other
792users.
793
794The change owner can always publish draft changes (even without having
795the `Publish Drafts` access right assigned).
796
797
798[[category_delete_drafts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800799=== Delete Drafts
David Pursehousebe7f4582012-12-12 11:21:29 +0900800
801This category permits users to delete draft changes uploaded by other
802users.
803
804The change owner can always delete draft changes (even without having
805the `Delete Drafts` access right assigned).
806
807
David Pursehouse59aee362012-11-15 17:25:17 +0900808[[category_edit_topic_name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800809=== Edit Topic Name
David Pursehouse59aee362012-11-15 17:25:17 +0900810
811This category permits users to edit the topic name of a change that
812is uploaded for review.
813
814The change owner, branch owners, project owners, and site administrators
815can always edit the topic name (even without having the `Edit Topic Name`
816access right assigned).
817
Edwin Kempin1f77b532013-11-08 07:16:31 +0100818Whether the topic can be edited on closed changes can be controlled
819by the 'Force Edit' flag. If this flag is not set the topic can only be
820edited on open changes.
821
David Pursehouse59aee362012-11-15 17:25:17 +0900822
Edwin Kempin4bf01962014-04-16 16:47:10 +0200823[[example_roles]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800824== Examples of typical roles in a project
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100825
826Below follows a set of typical roles on a server and which access
827rights these roles typically should be granted. You may see them as
David Pursehouse221d4f62012-06-08 17:38:08 +0900828general guidelines for a typical way to set up your project on a
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100829brand new Gerrit instance.
830
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200831
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100832[[examples_contributor]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800833=== Contributor
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100834
835This is the typical user on a public server. They are able to read
836your project and upload new changes to it. They are able to give
837feedback on other changes as well, but are unable to block or approve
838any changes.
839
840Suggested access rights to grant:
841
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800842* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
843* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
844* link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100845
Fredrik Luthanderd6c59252014-03-17 00:56:04 +0100846If it's desired to have the possibility to upload temporarily hidden
847changes there's a specific permission for that. This enables someone
848to add specific reviewers for early feedback before making the change
849publically visible. If you want to allow others than the owners to
850publish a draft you also need to grant them `Publish Drafts`.
851
852Optional access rights to grant:
853
854* xref:category_push[`Push`] to 'refs/drafts/*'
855* xref:category_publish_drafts[`Publish Drafts`] to 'refs/heads/*'
856
Fredrik Luthanderbc75ef72012-01-26 15:57:08 +0100857
Fredrik Luthander654161c2012-01-31 14:42:36 +0100858[[examples_developer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800859=== Developer
Fredrik Luthander654161c2012-01-31 14:42:36 +0100860
861This is the typical core developer on a public server. They are able
862to read the project, upload changes to a branch. They are allowed to
863push merge commits to merge branches together. Also, they are allowed
864to forge author identity, thus handling commits belonging to others
865than themselves, effectively allowing them to transfer commits
866between different branches.
867
868They are furthermore able to code review and verify commits, and
869eventually submit them. If you have an automated CI system that
870builds all uploaded patch sets you might want to skip the
871verification rights for the developer and let the CI system do that
872exclusively.
873
874Suggested access rights to grant:
875
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800876* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
877* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
878* xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*'
879* xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*'
880* 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 +0200881* link:config-labels.html#label_Verified[`Label: Verified`] with range '-1' to '+1' for 'refs/heads/*'
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800882* xref:category_submit[`Submit`]
Fredrik Luthander654161c2012-01-31 14:42:36 +0100883
884If the project is small or the developers are seasoned it might make
885sense to give them the freedom to push commits directly to a branch.
886
887Optional access rights to grant:
888
889* <<category_push,`Push`>> to 'refs/heads/*'
890* <<category_push_merge,`Push merge commit`>> to 'refs/heads/*'
891
892
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100893[[examples_cisystem]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800894=== CI system
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100895
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100896A typical Continuous Integration system should be able to download new changes
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100897to build and then leave a verdict somehow.
898
899As an example, the popular
900link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin]
901for Jenkins/Hudson can set labels at:
902
903* The start of a build
904* A successful build
905* An unstable build (tests fails)
906* A failed build
907
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200908Usually the range chosen for this verdict is the `Verified` label. Depending on
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100909the size of your project and discipline of involved developers you might want
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200910to limit access right to the +1 `Verified` label to the CI system only. That
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100911way it's guaranteed that submitted commits always get built and pass tests
912successfully.
913
914If the build doesn't complete successfully the CI system can set the
Peter Jönsson3bfcae72013-07-17 22:06:32 +0200915`Verified` label to -1. However that means that a failed build will block
916submit of the change even if someone else sets `Verified` +1. Depending on the
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100917project and how much the CI system can be trusted for accurate results, a
918blocking label might not be feasible. A recommended alternative is to set the
919label `Code-review` to -1 instead, as it isn't a blocking label but still
David Pursehouse221d4f62012-06-08 17:38:08 +0900920shows a red label in the Gerrit UI. Optionally, to enable the possibility to
921deliver different results (build error vs unstable for instance), it's also
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100922possible to set `Code-review` +1 as well.
923
Edwin Kempina2e13cf2012-03-30 09:02:36 +0200924If pushing new changes is granted, it's possible to automate cherry-pick of
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100925submitted changes for upload to other branches under certain conditions. This
926is probably not the first step of what a project wants to automate however,
927and so the push right can be found under the optional section.
928
929Suggested access rights to grant, that won't block changes:
930
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800931* xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*'
932* 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 +0200933* link:config-labels.html#label_Verified[`Label: Verified`] with range '0' to '+1' for 'refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100934
935Optional access rights to grant:
936
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800937* link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*'
938* xref:category_push[`Push`] to 'refs/for/refs/heads/*'
Fredrik Luthanderf2105be2012-01-27 12:44:05 +0100939
940
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100941[[examples_integrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800942=== Integrator
Fredrik Luthanderfe720022012-03-22 17:29:39 +0100943
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]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800960=== Project owner
Fredrik Luthander9c645362012-03-22 18:10:42 +0100961
962The project owner is almost like an integrator but with additional destructive
963power in the form of being able to delete branches. Optionally these users
964also have the power to configure access rights in gits assigned to them.
965
966[WARNING]
Gustaf Lundha28a1d22013-05-08 15:05:12 +0100967These users should be really knowledgeable about git, for instance knowing why
Fredrik Luthander9c645362012-03-22 18:10:42 +0100968tags never should be removed from a server. This role is granted potentially
969destructive access rights and cleaning up after such a mishap could be time
970consuming!
971
972Suggested access rights to grant:
973
974* <<examples_integrator,Integrator rights>>
975* <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*'
976
977Optional access right to grant:
978
979* <<category_owner,`Owner`>> in the gits they mostly work with.
980
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200981
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100982[[examples_administrator]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800983=== Administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100984
985The administrator role is the most powerful role known in the Gerrit universe.
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +0100986This role may grant itself (or others) any access right. By default the
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100987<<administrators,`Administrators` group>> is the group that has this role.
988
989Mandatory access rights:
990
991* <<capability_administrateServer,The `Administrate Server` capability>>
992
993Suggested access rights to grant:
994
Fredrik Luthanderb8eaa082014-03-17 01:02:22 +0100995* <<examples_project-owner,`Project owner rights`>>
996* Any <<global_capabilities,`capabilities`>> needed by the administrator
Fredrik Luthander5a8e7d82012-03-22 17:29:39 +0100997
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +0200998
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800999== Enforcing site wide access policies
Sasa Zivkovd589f462013-02-12 14:27:09 +01001000
1001By granting the <<category_owner,`Owner`>> access right on the `refs/*` to a
1002group, Gerrit administrators can delegate the responsibility of maintaining
1003access rights for that project to that group.
1004
1005In a corporate deployment it is often necessary to enforce some access
1006policies. An example could be that no-one can update or delete a tag, not even
1007the project owners. The 'ALLOW' and 'DENY' rules are not enough for this
1008purpose as project owners can grant themselves any access right they wish and,
1009thus, effectively override any inherited access rights from the
1010"`All-Projects`" or some other common parent project.
1011
1012What is needed is a mechanism to block a permission in a parent project so
1013that even project owners cannot allow a blocked permission in their child
1014project. Still, project owners should retain the possibility to manage all
1015non-blocked rules as they wish. This gives best of both worlds:
1016
1017* Gerrit administrators can concentrate on enforcing site wide policies
1018 and providing a meaningful set of default access permissions
1019* Project owners can manage access rights of their projects without a danger
1020 of violating a site wide policy
1021
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001022
Edwin Kempin60ab8532013-03-27 14:33:46 +01001023[[block]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001024=== 'BLOCK' access rule
Sasa Zivkovd589f462013-02-12 14:27:09 +01001025
1026The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK' rule cannot
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001027be overridden in the inheriting project. Any 'ALLOW' rule, from a different
1028access section or from an inheriting project, which conflicts with an
1029inherited 'BLOCK' rule will not be honored. Searching for 'BLOCK' rules, in
Sasa Zivkovd589f462013-02-12 14:27:09 +01001030the chain of parent projects, ignores the Exclusive flag that is normally
1031applied to access sections.
1032
1033A 'BLOCK' rule that blocks the 'push' permission blocks any type of push,
1034force or not. A blocking force push rule blocks only force pushes, but
1035allows non-forced pushes if an 'ALLOW' rule would have permitted it.
1036
1037It is also possible to block label ranges. To block a group 'X' from voting
1038'-2' and '+2', but keep their existing voting permissions for the '-1..+1'
1039range intact we would define:
1040
1041====
1042 [access "refs/heads/*"]
1043 label-Code-Review = block -2..+2 group X
1044====
1045
1046The interpretation of the 'min..max' range in case of a blocking rule is: block
1047every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it
1048means that the range '-1..+1' is not affected by this block.
1049
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001050=== 'BLOCK' and 'ALLOW' rules in the same access section
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001051
1052When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for
1053the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule:
1054
1055====
1056 [access "refs/heads/*"]
1057 push = block group X
1058 push = group Y
1059====
1060
1061In this case a user which is a member of the group 'Y' will still be allowed to
1062push to 'refs/heads/*' even if it is a member of the group 'X'.
1063
1064NOTE: An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are
1065inside the same access section of the same project. An 'ALLOW' rule in a
1066different access section of the same project or in any access section in an
1067inheriting project cannot override a 'BLOCK' rule.
1068
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001069
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001070=== Examples
Sasa Zivkovd589f462013-02-12 14:27:09 +01001071
1072The following examples show some possible use cases for the 'BLOCK' rules.
1073
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001074==== Make sure no one can update or delete a tag
Sasa Zivkovd589f462013-02-12 14:27:09 +01001075
1076This requirement is quite common in a corporate deployment where
1077reproducibility of a build must be guaranteed. To achieve that we block 'push'
1078permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`":
1079
1080====
1081 [access "refs/tags/*"]
1082 push = block group Anonymous Users
1083====
1084
1085By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block
1086everyone as everyone is a member of that group. Note that the permission to
1087create a tag is still necessary. Assuming that only <<category_owner,project
1088owners>> are allowed to create tags, we would extend the example above:
1089
1090====
1091 [access "refs/tags/*"]
1092 push = block group Anonymous Users
1093 create = group Project Owners
1094 pushTag = group Project Owners
1095====
Fredrik Luthander9c645362012-03-22 18:10:42 +01001096
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001097
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001098==== Let only a dedicated group vote in a special category
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001099
1100Assume there is a more restrictive process for submitting changes in stable
1101release branches which is manifested as a new voting category
1102'Release-Process'. Assume we want to make sure that only a 'Release Engineers'
1103group can vote in this category and that even project owners cannot approve
1104this category. We have to block everyone except the 'Release Engineers' to vote
1105in this category and, of course, allow 'Release Engineers' to vote in that
1106category. In the "`All-Projects`" we define the following rules:
1107
1108====
1109 [access "refs/heads/stable*"]
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001110 label-Release-Process = block -1..+1 group Anonymous Users
1111 label-Release-Process = -1..+1 group Release Engineers
Sasa Zivkovcff084b2013-01-15 18:52:32 +01001112====
1113
David Pursehouse8becc2a2013-04-23 18:51:04 +09001114[[global_capabilities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001115== Global Capabilities
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001116
David Pursehouse8becc2a2013-04-23 18:51:04 +09001117The global capabilities control actions that the administrators of
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001118the server can perform which usually affect the entire
1119server in some way. The administrators may delegate these
1120capabilities to trusted groups of users.
1121
1122Delegation of capabilities allows groups to be granted a subset of
1123administrative capabilities without being given complete
1124administrative control of the server. This makes it possible to
1125keep fewer users in the administrators group, even while spreading
1126much of the server administration burden out to more users.
1127
David Pursehouse8becc2a2013-04-23 18:51:04 +09001128Global capabilities are assigned to groups in the access rights settings
1129of the root project ("`All-Projects`").
1130
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001131Below you find a list of capabilities available:
1132
1133
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001134[[capability_accessDatabase]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001135=== Access Database
David Pursehouse11c4c5f2013-06-09 08:07:23 +09001136
1137Allow users to access the database using the `gsql` command.
1138
1139
Fredrik Luthander426885f2012-02-13 09:56:57 +01001140[[capability_administrateServer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001141=== Administrate Server
Fredrik Luthander426885f2012-02-13 09:56:57 +01001142
1143This is in effect the owner and administrator role of the Gerrit
1144instance. Any members of a group granted this capability will be
1145able to grant any access right to any group. They will also have all
1146capabilities granted to them automatically.
1147
1148
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001149[[capability_createAccount]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001150=== Create Account
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001151
Fredrik Luthander79d38152012-03-13 09:52:22 +01001152Allow link:cmd-create-account.html[account creation over the ssh prompt].
Fredrik Luthanderb02afca2012-02-13 09:59:48 +01001153This capability allows the granted group members to create non-interactive
1154service accounts. These service accounts are generally used for automation
1155and made to be members of the
1156link:access-control.html#non-interactive_users['Non-Interactive users'] group.
1157
1158
Fredrik Luthander79d38152012-03-13 09:52:22 +01001159[[capability_createGroup]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001160=== Create Group
Fredrik Luthander79d38152012-03-13 09:52:22 +01001161
1162Allow group creation. Groups are used to grant users access to different
1163actions in projects. This capability allows the granted group members to
1164either link:cmd-create-group.html[create new groups via ssh] or via the web UI.
1165
1166
1167[[capability_createProject]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001168=== Create Project
Fredrik Luthander79d38152012-03-13 09:52:22 +01001169
1170Allow project creation. This capability allows the granted group to
1171either link:cmd-create-project.html[create new git projects via ssh]
1172or via the web UI.
1173
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001174
Sasa Zivkov812f4892012-06-21 16:25:21 +02001175[[capability_emailReviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001176=== Email Reviewers
Sasa Zivkov812f4892012-06-21 16:25:21 +02001177
1178Allow or deny sending email to change reviewers and watchers. This can be used
1179to deny build bots from emailing reviewers and people who watch the change.
1180Instead, only the authors of the change and those who starred it will be
1181emailed. The allow rules are evaluated before deny rules, however the default
1182is to allow emailing, if no explicit rule is matched.
Fredrik Luthander79d38152012-03-13 09:52:22 +01001183
Fredrik Luthandera8aa9c52013-05-09 14:50:39 +02001184
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001185[[capability_flushCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001186=== Flush Caches
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001187
Fredrik Luthander48603002012-03-21 18:17:17 +01001188Allow the flushing of Gerrit's caches. This capability allows the granted
Fredrik Luthander74ad0d02012-03-13 13:06:30 +01001189group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh].
1190
1191[NOTE]
1192This capability doesn't imply permissions to the show-caches command. For that
1193you need the <<capability_viewCaches,view caches capability>>.
1194
1195
David Pursehousecbd22ac2013-06-09 08:03:14 +09001196[[capability_generateHttpPassword]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001197=== Generate HTTP Password
David Pursehousecbd22ac2013-06-09 08:03:14 +09001198
1199Allow the user to generate HTTP passwords for other users. Typically this would
1200be assigned to a non-interactive users group.
1201
1202
Fredrik Luthander46843022012-03-13 16:11:02 +01001203[[capability_kill]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001204=== Kill Task
Fredrik Luthander46843022012-03-13 16:11:02 +01001205
1206Allow the operation of the link:cmd-kill.html[kill command over ssh]. The
1207kill command ends tasks that currently occupy the Gerrit server, usually
1208a replication task or a user initiated task such as an upload-pack or
Gustaf Lundha28a1d22013-05-08 15:05:12 +01001209receive-pack.
Fredrik Luthander46843022012-03-13 16:11:02 +01001210
1211
1212[[capability_priority]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001213=== Priority
Fredrik Luthander46843022012-03-13 16:11:02 +01001214
1215This capability allows users to use
1216link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for
1217link:access-control.html#non-interactive_users['Non-Interactive Users'].
1218It's a binary value in that granted users either have access to the thread
1219pool, or they don't.
1220
1221There are three modes for this capability and they're listed by rising
1222priority:
1223
1224No capability configured.::
1225The user isn't a member of a group with any priority capability granted. By
1226default the user is then in the 'INTERACTIVE' thread pool.
1227
1228'BATCH'::
1229If there's a thread pool configured for 'Non-Interactive Users' and a user is
1230granted the priority capability with the 'BATCH' mode selected, the user ends
1231up in the separate batch user thread pool. This is true unless the user is
1232also granted the below 'INTERACTIVE' option.
1233
1234'INTERACTIVE'::
1235If a user is granted the priority capability with the 'INTERACTIVE' option,
1236regardless if they also have the 'BATCH' option or not, they are in the
1237'INTERACTIVE' thread pool.
1238
1239
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001240[[capability_queryLimit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001241=== Query Limit
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001242
1243Allow site administrators to configure the query limit for users to
1244be above the default hard-coded value of 500. Administrators can add
David Pursehouseb5d99aaf2013-08-09 11:02:48 +09001245a global block to `All-Projects` with group(s) that should have different
1246limits.
Fredrik Luthander80ebf9d2012-02-13 09:32:43 +01001247
1248When applying a query limit to a user the largest value granted by
1249any of their groups is used.
1250
1251This limit applies not only to the link:cmd-query.html[`gerrit query`]
1252command, but also to the web UI results pagination size.
1253
1254
Shawn Pearcebb027b02013-06-10 14:35:39 -07001255[[capability_runAs]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001256=== Run As
Shawn Pearcebb027b02013-06-10 14:35:39 -07001257
Shawn Pearcef3ffd082013-06-12 11:21:35 -07001258Allow users to impersonate any other user with the `X-Gerrit-RunAs`
1259HTTP header on REST API calls, or the link:cmd-suexec.html[suexec]
1260SSH command.
1261
1262When impersonating an administrator the Administrate Server capability
1263is not honored. This security feature tries to prevent a role with
1264Run As capability from modifying the access controls in All-Projects,
1265however modification may still be possible if the impersonated user
1266has permission to push or submit changes on `refs/meta/config`. Run
1267As also blocks using most capabilities including Create User, Run
1268Garbage Collection, etc., unless the capability is also explicitly
1269granted to a group the administrator is a member of.
1270
1271Administrators do not automatically inherit this capability; it must
1272be explicitly granted.
Shawn Pearcebb027b02013-06-10 14:35:39 -07001273
1274
Edwin Kempin619169b2012-02-09 15:47:52 +01001275[[capability_runGC]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001276=== Run Garbage Collection
Edwin Kempin619169b2012-02-09 15:47:52 +01001277
1278Allow users to run the Git garbage collection for the repositories of
1279all projects.
1280
1281
Ed Bartoshd168b812013-04-13 20:15:58 +03001282[[capability_streamEvents]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001283=== Stream Events
Ed Bartoshd168b812013-04-13 20:15:58 +03001284
1285Allow performing streaming of Gerrit events. This capability
1286allows the granted group to
1287link:cmd-stream-events.html[stream Gerrit events via ssh].
1288
1289
Dave Borowitzf3548a92014-02-20 11:02:19 -08001290[[capability_viewAllAccounts]]
1291=== View All Accounts
1292
1293Allow viewing all accounts for purposes of auto-completion, regardless
1294of link:config-gerrit.html#accounts.visibility[accounts.visibility]
1295setting.
1296
1297
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001298[[capability_viewCaches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001299=== View Caches
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001300
Fredrik Luthander48603002012-03-21 18:17:17 +01001301Allow querying for status of Gerrit's internal caches. This capability allows
Fredrik Luthander9c7da662012-03-13 17:49:27 +01001302the granted group to
1303link:cmd-show-caches.html[look at some or all Gerrit caches via ssh].
1304
1305
Fredrik Luthander48603002012-03-21 18:17:17 +01001306[[capability_viewConnections]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001307=== View Connections
Fredrik Luthander48603002012-03-21 18:17:17 +01001308
1309Allow querying for status of Gerrit's current client connections. This
1310capability allows the granted group to
1311link:cmd-show-connections.html[look at Gerrit's current connections via ssh].
1312
1313
Edwin Kempin362b14d12014-05-09 14:18:12 +02001314[[capability_viewPlugins]]
1315=== View Plugins
1316
1317Allow viewing the list of installed plugins.
1318
1319
Fredrik Luthander48603002012-03-21 18:17:17 +01001320[[capability_viewQueue]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001321=== View Queue
Fredrik Luthander48603002012-03-21 18:17:17 +01001322
1323Allow querying for status of Gerrit's internal task queue. This capability
1324allows the granted group to
1325link:cmd-show-queue.html[look at the Gerrit task queue via ssh].
1326
1327
Shawn O. Pearce5500e692009-05-28 15:55:01 -07001328GERRIT
1329------
1330Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07001331
1332SEARCHBOX
1333---------