Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - Access Controls |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 2 | |
| 3 | Access controls in Gerrit are group based. Every user account is a |
| 4 | member of one or more groups, and access and privileges are granted |
Matt Fischer | 620255a | 2011-03-22 14:28:23 -0500 | [diff] [blame] | 5 | to those groups. Access rights cannot be granted to individual |
| 6 | users. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 7 | |
| 8 | |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 9 | [[system_groups]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 10 | == System Groups |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 11 | |
Anita Kuno | 178f64b | 2014-04-22 18:52:28 -0400 | [diff] [blame] | 12 | Gerrit comes with the following system groups: |
Khai Do | 4245e6f | 2013-10-11 18:14:31 +0200 | [diff] [blame] | 13 | |
Khai Do | 4245e6f | 2013-10-11 18:14:31 +0200 | [diff] [blame] | 14 | * Anonymous Users |
| 15 | * Change Owner |
Khai Do | 4245e6f | 2013-10-11 18:14:31 +0200 | [diff] [blame] | 16 | * Project Owners |
| 17 | * Registered Users |
| 18 | |
| 19 | The system groups are assigned special access and membership management |
Jonathan Nieder | 2b2d62b | 2014-05-07 19:40:58 -0700 | [diff] [blame] | 20 | privileges. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 21 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 22 | |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 23 | [[anonymous_users]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 24 | === Anonymous Users |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 25 | |
| 26 | All users are automatically a member of this group. Users who are |
| 27 | not signed in are a member of only this group, and no others. |
| 28 | |
| 29 | Any access rights assigned to this group are inherited by all users. |
| 30 | |
| 31 | Administrators and project owners can grant access rights to this |
| 32 | group in order to permit anonymous users to view project changes, |
| 33 | without requiring sign in first. Currently it is only worthwhile |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 34 | to grant `Read` access to this group as Gerrit requires an account |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 35 | identity for all other operations. |
| 36 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 37 | |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 38 | [[project_owners]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 39 | === Project Owners |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 40 | |
| 41 | Access rights assigned to this group are always evaluated within the |
| 42 | context of a project to which the access rights apply. These rights |
| 43 | therefore apply to all the users who are owners of this project. |
| 44 | |
| 45 | By assigning access rights to this group on a parent project Gerrit |
| 46 | administrators can define a set of default access rights for |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 47 | <<category_owner,project owners>>. Child projects inherit these |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 48 | access rights where they are resolved to the users that own the child |
| 49 | project. Having default access rights for |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 50 | <<category_owner,project owners>> assigned on a parent project may |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 51 | avoid the need to initially configure access rights for |
| 52 | newly created child projects. |
| 53 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 54 | |
Khai Do | 4245e6f | 2013-10-11 18:14:31 +0200 | [diff] [blame] | 55 | [[change_owner]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 56 | === Change Owner |
Khai Do | 4245e6f | 2013-10-11 18:14:31 +0200 | [diff] [blame] | 57 | |
| 58 | Access rights assigned to this group are always evaluated within the |
| 59 | context of a change to which the access rights apply. These rights |
| 60 | therefore apply to the user who is the owner of this change. |
| 61 | |
| 62 | It is typical to assign a label to this group, allowing the change |
| 63 | owner to vote on his change, but not actually cause it to become |
| 64 | approved or rejected. |
| 65 | |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 66 | [[registered_users]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 67 | === Registered Users |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 68 | |
| 69 | All signed-in users are automatically a member of this group (and |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 70 | also <<anonymous_users,'Anonymous Users'>>, see above). |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 71 | |
| 72 | Any access rights assigned to this group are inherited by all |
| 73 | users as soon as they sign-in to Gerrit. If OpenID authentication |
| 74 | is being employed, moving from only 'Anonymous Users' into this |
| 75 | group is very easy. Caution should be taken when assigning any |
| 76 | permissions to this group. |
| 77 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 78 | It is typical to assign `Code-Review -1..+1` to this group, |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 79 | allowing signed-in users to vote on a change, but not actually |
| 80 | cause it to become approved or rejected. |
| 81 | |
| 82 | Registered users are always permitted to make and publish comments |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 83 | on any change in any project they have `Read` access to. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 84 | |
| 85 | |
Jonathan Nieder | 2b2d62b | 2014-05-07 19:40:58 -0700 | [diff] [blame] | 86 | == Predefined Groups |
| 87 | |
| 88 | Predefined groups differs from system groups by the fact that they |
| 89 | exist in the ACCOUNT_GROUPS table (like normal groups) but predefined groups |
| 90 | are created on Gerrit site initialization and unique UUIDs are assigned |
| 91 | to those groups. These UUIDs are different on different Gerrit sites. |
| 92 | |
| 93 | Gerrit comes with two predefined groups: |
| 94 | |
| 95 | * Administrators |
| 96 | * Non-Interactive Users |
| 97 | |
| 98 | |
| 99 | [[administrators]] |
| 100 | === Administrators |
| 101 | |
| 102 | This is the Gerrit "root" identity. The capability |
| 103 | link:access-control.html#capability_administrateServer['Administrate Server'] |
| 104 | is assigned to this predefined group on Gerrit site creation. |
| 105 | |
| 106 | Users in the 'Administrators' group can perform any action under |
| 107 | the Admin menu, to any group or project, without further validation |
| 108 | or any other access controls. In most installations only those |
| 109 | users who have direct filesystem and database access would be |
| 110 | placed into this group. |
| 111 | |
| 112 | Membership in the 'Administrators' group does not imply any other |
| 113 | access rights. Administrators do not automatically get code review |
| 114 | approval or submit rights in projects. This is a feature designed |
| 115 | to permit administrative users to otherwise access Gerrit as any |
| 116 | other normal user would, without needing two different accounts. |
| 117 | |
| 118 | |
| 119 | [[non-interactive_users]] |
| 120 | === Non-Interactive Users |
| 121 | |
| 122 | This is the Gerrit "batch" identity. The capabilities |
| 123 | link:access-control.html#capability_priority['Priority BATCH'] and |
| 124 | link:access-control.html#capability_streamEvents['Stream Events'] |
| 125 | are assigned to this predefined group on Gerrit site creation. |
| 126 | |
| 127 | The members of this group are not expected to perform interactive |
| 128 | operations on the Gerrit web front-end. |
| 129 | |
| 130 | However, sometimes such a user may need a separate thread pool in |
| 131 | order to prevent it from grabbing threads from the interactive users. |
| 132 | |
| 133 | These users live in a second thread pool, which separates operations |
| 134 | made by the non-interactive users from the ones made by the interactive |
| 135 | users. This ensures that the interactive users can keep working when |
| 136 | resources are tight. |
| 137 | |
| 138 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 139 | == Account Groups |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 140 | |
| 141 | Account groups contain a list of zero or more user account members, |
| 142 | added individually by a group owner. Any user account listed as |
| 143 | a group member is given any access rights granted to the group. |
| 144 | |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 145 | Every group has one other group designated as its owner. Users who |
| 146 | are members of the owner group can: |
| 147 | |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 148 | * Add users and other groups to this group |
| 149 | * Remove users and other groups from this group |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 150 | * Change the name of this group |
| 151 | * Change the description of this group |
| 152 | * Change the owner of this group, to another group |
| 153 | |
| 154 | It is permissible for a group to own itself, allowing the group |
| 155 | members to directly manage who their peers are. |
| 156 | |
| 157 | Newly created groups are automatically created as owning themselves, |
| 158 | with the creating user as the only member. This permits the group |
| 159 | creator to add additional members, and change the owner to another |
| 160 | group if desired. |
| 161 | |
| 162 | It is somewhat common to create two groups at the same time, |
| 163 | for example `Foo` and `Foo-admin`, where the latter group |
| 164 | `Foo-admin` owns both itself and also group `Foo`. Users who |
| 165 | are members of `Foo-admin` can thus control the membership of |
| 166 | `Foo`, without actually having the access rights granted to `Foo`. |
| 167 | This configuration can help prevent accidental submits when the |
| 168 | members of `Foo` have submit rights on a project, and the members of |
| 169 | `Foo-admin` typically do not need to have such rights. |
| 170 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 171 | |
Thanh Ha | 6eed43f | 2013-04-11 21:03:55 -0400 | [diff] [blame] | 172 | [[ldap_groups]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 173 | == LDAP Groups |
Thanh Ha | 6eed43f | 2013-04-11 21:03:55 -0400 | [diff] [blame] | 174 | |
| 175 | LDAP groups are Account Groups that are maintained inside of your |
| 176 | LDAP instance. If you are using LDAP to manage your groups they will |
| 177 | not appear in the Groups list. However you can use them just like |
| 178 | regular Account Groups by prefixing your group with "ldap/" in the |
| 179 | Access Control for a project. For example "ldap/foo-project" will |
| 180 | add the LDAP "foo-project" group to the access list. |
| 181 | |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 182 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 183 | == Project Access Control Lists |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 184 | |
lincoln | fa7bdd3 | 2010-04-22 14:23:05 -0300 | [diff] [blame] | 185 | A system wide access control list affecting all projects is stored in |
Shawn O. Pearce | a063182 | 2011-06-14 11:18:18 -0700 | [diff] [blame] | 186 | project "`All-Projects`". This inheritance can be configured |
lincoln | fa7bdd3 | 2010-04-22 14:23:05 -0300 | [diff] [blame] | 187 | through link:cmd-set-project-parent.html[gerrit set-project-parent]. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 188 | |
| 189 | Per-project access control lists are also supported. |
| 190 | |
| 191 | Users are permitted to use the maximum range granted to any of their |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 192 | groups on a label. For example, a user is a member of `Foo Leads`, and |
| 193 | the following ACLs are granted on a project: |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 194 | |
Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 195 | [options="header"] |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 196 | |=================================================== |
| 197 | |Group |Reference Name |Label |Range |
| 198 | |Anonymous Users |refs/heads/* |Code-Review|-1..+1 |
| 199 | |Registered Users|refs/heads/* |Code-Review|-1..+2 |
| 200 | |Foo Leads |refs/heads/* |Code-Review|-2..0 |
| 201 | |=================================================== |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 202 | |
| 203 | Then the effective range permitted to be used by the user is |
| 204 | `-2..+2`, as the user is a member of all three groups (see above |
| 205 | about the system groups) and the maximum range is chosen (so the |
| 206 | lowest value granted to any group, and the highest value granted |
| 207 | to any group). |
| 208 | |
Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 209 | Reference-level access control is also possible. |
| 210 | |
| 211 | Permissions can be set on a single reference name to match one |
| 212 | branch (e.g. `refs/heads/master`), or on a reference namespace |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 213 | (e.g. `+refs/heads/*+`) to match any branch starting with that |
| 214 | prefix. So a permission with `+refs/heads/*+` will match |
Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 215 | `refs/heads/master` and `refs/heads/experimental`, etc. |
| 216 | |
Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 217 | Reference names can also be described with a regular expression |
Edwin Kempin | a2bf083 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 218 | by prefixing the reference name with `^`. For example |
| 219 | `^refs/heads/[a-z]{1,8}` matches all lower case branch names |
Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 220 | between 1 and 8 characters long. Within a regular expression `.` |
| 221 | is a wildcard matching any character, but may be escaped as `\.`. |
Magnus Bäck | e561183 | 2011-02-02 08:57:15 +0100 | [diff] [blame] | 222 | The link:http://www.brics.dk/automaton/[dk.brics.automaton library] |
| 223 | is used for evaluation of regular expression access control |
| 224 | rules. See the library documentation for details on this |
| 225 | particular regular expression flavor. |
Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 226 | |
| 227 | References can have the current user name automatically included, |
| 228 | creating dynamic access controls that change to match the currently |
| 229 | logged in user. For example to provide a personal sandbox space |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 230 | to all developers, `+refs/heads/sandbox/${username}/*+` allowing |
Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 231 | the user 'joe' to use 'refs/heads/sandbox/joe/foo'. |
| 232 | |
Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 233 | When evaluating a reference-level access right, Gerrit will use |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 234 | the full set of access rights to determine if the user |
| 235 | is allowed to perform a given action. For example, if a user is a |
| 236 | member of `Foo Leads`, they are reviewing a change destined for |
| 237 | the `refs/heads/qa` branch, and the following ACLs are granted |
| 238 | on the project: |
Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 239 | |
Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 240 | [options="header"] |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 241 | |=============================================================== |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 242 | |Group |Reference Name|Label |Range |Exclusive |
| 243 | |Registered Users |refs/heads/* |Code-Review| -1..+1 | |
| 244 | |Foo Leads |refs/heads/* |Code-Review| -2..+2 | |
| 245 | |QA Leads |refs/heads/qa |Code-Review| -2..+2 | |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 246 | |=============================================================== |
Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 247 | |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 248 | Then the effective range permitted to be used by the user is |
| 249 | `-2..+2`, as the user's membership of `Foo Leads` effectively grant |
| 250 | them access to the entire reference space, thanks to the wildcard. |
| 251 | |
| 252 | Gerrit also supports exclusive reference-level access control. |
| 253 | |
| 254 | It is possible to configure Gerrit to grant an exclusive ref level |
| 255 | access control so that only users of a specific group can perform |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 256 | an operation on a project/reference pair. This is done by ticking |
| 257 | the exclusive flag when setting the permission for the |
| 258 | `refs/heads/qa` branch. |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 259 | |
| 260 | For example, if a user who is a member of `Foo Leads` tries to |
| 261 | review a change destined for branch `refs/heads/qa` in a project, |
| 262 | and the following ACLs are granted: |
| 263 | |
Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 264 | [options="header"] |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 265 | |============================================================== |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 266 | |Group |Reference Name|Label |Range |Exclusive |
| 267 | |Registered Users|refs/heads/* |Code-Review| -1..+1 | |
| 268 | |Foo Leads |refs/heads/* |Code-Review| -2..+2 | |
| 269 | |QA Leads |refs/heads/qa |Code-Review| -2..+2 |X |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 270 | |============================================================== |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 271 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 272 | Then this user will not have `Code-Review` rights on that change, |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 273 | since there is an exclusive access right in place for the |
| 274 | `refs/heads/qa` branch. This allows locking down access for a |
| 275 | particular branch to a limited set of users, bypassing inherited |
| 276 | rights and wildcards. |
| 277 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 278 | In order to grant the ability to `Code-Review` to the members of |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 279 | `Foo Leads`, in `refs/heads/qa` then the following access rights |
| 280 | would be needed: |
| 281 | |
Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 282 | [options="header"] |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 283 | |============================================================== |
| 284 | |Group |Reference Name|Category |Range |Exclusive |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 285 | |Registered Users|refs/heads/* |Code-Review| -1..+1 | |
| 286 | |Foo Leads |refs/heads/* |Code-Review| -2..+2 | |
| 287 | |QA Leads |refs/heads/qa |Code-Review| -2..+2 |X |
| 288 | |Foo Leads |refs/heads/qa |Code-Review| -2..+2 | |
Fredrik Luthander | 54abc35 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 289 | |============================================================== |
Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 290 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 291 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 292 | === OpenID Authentication |
Shawn O. Pearce | a229966 | 2009-02-25 14:34:40 -0800 | [diff] [blame] | 293 | |
| 294 | If the Gerrit instance is configured to use OpenID authentication, |
| 295 | an account's effective group membership will be restricted to only |
| 296 | the `Anonymous Users` and `Registered Users` groups, unless *all* |
| 297 | of its OpenID identities match one or more of the patterns listed |
Shawn O. Pearce | d7c026d | 2009-08-05 20:11:22 -0700 | [diff] [blame] | 298 | in the `auth.trustedOpenID` list from `gerrit.config`. |
Shawn O. Pearce | a229966 | 2009-02-25 14:34:40 -0800 | [diff] [blame] | 299 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 300 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 301 | === All Projects |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 302 | |
Shawn O. Pearce | a063182 | 2011-06-14 11:18:18 -0700 | [diff] [blame] | 303 | Any access right granted to a group within `All-Projects` |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 304 | is automatically inherited by every other project in the same |
| 305 | Gerrit instance. These rights can be seen, but not modified, |
| 306 | in any other project's `Access` administration tab. |
| 307 | |
Fredrik Luthander | d996088 | 2011-11-08 01:42:19 +0100 | [diff] [blame] | 308 | Only members of the groups with the `Administrate Server` capability |
| 309 | may edit the access control list for `All-Projects`. By default this |
| 310 | capability is given to the group `Administrators`, but can be given |
| 311 | to more groups. |
Shawn O. Pearce | e2c2a22 | 2010-05-11 13:43:45 -0700 | [diff] [blame] | 312 | |
| 313 | Ownership of this project cannot be delegated to another group. |
| 314 | This restriction is by design. Granting ownership to another |
| 315 | group gives nearly the same level of access as membership in |
| 316 | `Administrators` does, as group members would be able to alter |
Fredrik Luthander | d996088 | 2011-11-08 01:42:19 +0100 | [diff] [blame] | 317 | permissions for every managed project including global capabilities. |
Shawn O. Pearce | e2c2a22 | 2010-05-11 13:43:45 -0700 | [diff] [blame] | 318 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 319 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 320 | === Per-Project |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 321 | |
Fredrik Luthander | da86788 | 2011-12-21 18:28:40 +0100 | [diff] [blame] | 322 | The per-project ACL is evaluated before the global `All-Projects` ACL, |
| 323 | permitting some limited override capability to project owners. This |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 324 | behavior is generally only useful on the `Read` category when |
| 325 | granting 'DENY' within a specific project to deny a group access. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 326 | |
| 327 | |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 328 | [[references]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 329 | == Special and magic references |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 330 | |
| 331 | The reference namespaces used in git are generally two, one for branches and |
| 332 | one for tags: |
| 333 | |
| 334 | * +refs/heads/*+ |
| 335 | * +refs/tags/*+ |
| 336 | |
| 337 | However, every reference under +refs/*+ is really available, and in Gerrit this |
| 338 | opportunity for giving other refs a special meaning is used. In Gerrit they |
| 339 | are sometimes used as magic/virtual references that give the push to Gerrit a |
| 340 | special meaning. |
| 341 | |
| 342 | |
| 343 | [[references_special]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 344 | === Special references |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 345 | |
| 346 | The special references have content that's either generated by Gerrit or |
| 347 | contains important project configuration that Gerrit needs. When making |
| 348 | changes to these references, Gerrit will take extra precautions to verify the |
| 349 | contents compatibility at upload time. |
| 350 | |
| 351 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 352 | ==== refs/changes/* |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 353 | |
| 354 | Under this namespace each uploaded patch set for every change gets a static |
| 355 | reference in their git. The format is convenient but still intended to scale to |
| 356 | hundreds of thousands of patch sets. To access a given patch set you will |
| 357 | need the change number and patch set number. |
| 358 | |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 359 | -- |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 360 | 'refs/changes/'<last two digits of change number>/ |
| 361 | <change number>/ |
| 362 | <patch set number> |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 363 | -- |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 364 | |
| 365 | You can also find these static references linked on the page of each change. |
| 366 | |
| 367 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 368 | ==== refs/meta/config |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 369 | |
Matt Baker | 3a40c6d | 2013-11-26 21:01:17 -0700 | [diff] [blame] | 370 | This is where the Gerrit configuration of each project resides. This |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 371 | branch contains several files of importance: +project.config+, +groups+ and |
Matt Baker | 3a40c6d | 2013-11-26 21:01:17 -0700 | [diff] [blame] | 372 | +rules.pl+. Together they control access and behavior during the change |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 373 | review process. |
| 374 | |
| 375 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 376 | ==== refs/meta/dashboards/* |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 377 | |
| 378 | There's a dedicated page where you can read more about |
| 379 | link:user-dashboards.html[User Dashboards]. |
| 380 | |
| 381 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 382 | ==== refs/notes/review |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 383 | |
| 384 | Autogenerated copy of review notes for all changes in the git. Each log entry |
| 385 | on the refs/notes/review branch also references the patch set on which the |
| 386 | review is made. This functionality is provided by the review-notes plugin. |
| 387 | |
| 388 | |
| 389 | [[references_magic]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 390 | === Magic references |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 391 | |
| 392 | These are references with added functionality to them compared to a regular |
| 393 | git push operation. |
| 394 | |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 395 | [[refs_for]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 396 | ==== refs/for/<branch ref> |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 397 | |
| 398 | Most prominent is the `refs/for/<branch ref>` reference which is the reference |
| 399 | upon which we build the code review intercept before submitting a commit to |
| 400 | the branch it's uploaded to. |
| 401 | |
| 402 | Further documentation on how to push can be found on the |
| 403 | link:user-upload.html#push_create[Upload changes] page. |
| 404 | |
| 405 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 406 | ==== refs/publish/* |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 407 | |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 408 | `+refs/publish/*+` is an alternative name to `+refs/for/*+` when pushing new changes |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 409 | and patch sets. |
| 410 | |
| 411 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 412 | ==== refs/drafts/* |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 413 | |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 414 | Push to `+refs/drafts/*+` creates a change like push to `+refs/for/*+`, except the |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 415 | resulting change remains hidden from public review. You then have the option |
| 416 | of adding individual reviewers before making the change public to all. The |
| 417 | change page will have a 'Publish' button which allows you to convert individual |
| 418 | draft patch sets of a change into public patch sets for review. |
| 419 | |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 420 | To block push permission to `+refs/drafts/*+` the following permission rule can |
David Ostrovsky | 07ddca5 | 2014-01-21 22:51:47 +0100 | [diff] [blame] | 421 | be configured: |
| 422 | |
| 423 | ==== |
| 424 | [access "refs/drafts/*"] |
| 425 | push = block group Anonymous Users |
| 426 | ==== |
| 427 | |
Fredrik Luthander | 9803025 | 2012-04-13 11:01:22 +0200 | [diff] [blame] | 428 | |
Fredrik Luthander | 5ccf2e4 | 2013-05-08 01:06:25 +0200 | [diff] [blame] | 429 | [[access_categories]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 430 | == Access Categories |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 431 | |
Fredrik Luthander | 5ccf2e4 | 2013-05-08 01:06:25 +0200 | [diff] [blame] | 432 | Gerrit has several permission categories that can be granted to groups |
| 433 | within projects, enabling functionality for that group's members. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 434 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 435 | |
Fredrik Luthander | 69236de | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 436 | |
Chad Horohoe | 029c85a | 2012-06-07 16:10:14 -0400 | [diff] [blame] | 437 | [[category_abandon]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 438 | === Abandon |
Chad Horohoe | 029c85a | 2012-06-07 16:10:14 -0400 | [diff] [blame] | 439 | |
| 440 | This category controls whether users are allowed to abandon changes |
| 441 | to projects in Gerrit. It can give permission to abandon a specific |
| 442 | change to a given ref. |
| 443 | |
David Pursehouse | c795eb1 | 2013-07-05 14:20:28 +0900 | [diff] [blame] | 444 | This also grants the permission to restore a change if the user also |
| 445 | has link:#category_push[push permission] on the change's destination |
| 446 | ref. |
Chad Horohoe | 35ced0a | 2012-06-27 19:20:34 -0400 | [diff] [blame] | 447 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 448 | |
Fredrik Luthander | e9eeeea | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 449 | [[category_create]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 450 | === Create Reference |
Fredrik Luthander | e9eeeea | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 451 | |
| 452 | The create reference category controls whether it is possible to |
| 453 | create new references, branches or tags. This implies that the |
| 454 | reference must not already exist, it's not a destructive permission |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 455 | in that you can't overwrite or remove any previously existing |
Fredrik Luthander | e9eeeea | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 456 | references (and also discard any commits in the process). |
| 457 | |
| 458 | It's probably most common to either permit the creation of a single |
| 459 | branch in many gits (by granting permission on a parent project), or |
| 460 | to grant this permission to a name pattern of branches. |
| 461 | |
| 462 | This permission is often given in conjunction with regular push |
| 463 | branch permissions, allowing the holder of both to create new branches |
| 464 | as well as bypass review for new commits on that branch. |
| 465 | |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 466 | To push lightweight (non-annotated) tags, grant |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 467 | `Create Reference` for reference name `+refs/tags/*+`, as lightweight |
Fredrik Luthander | e9eeeea | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 468 | tags are implemented just like branches in Git. |
| 469 | |
| 470 | For example, to grant the possibility to create new branches under the |
| 471 | namespace `foo`, you have to grant this permission on |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 472 | `+refs/heads/foo/*+` for the group that should have it. |
Fredrik Luthander | e9eeeea | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 473 | Finally, if you plan to grant each user a personal namespace in |
| 474 | where they are free to create as many branches as they wish, you |
| 475 | should grant the create reference permission so it's possible |
| 476 | to create new branches. This is done by using the special |
| 477 | `${username}` keyword in the reference pattern, e.g. |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 478 | `+refs/heads/sandbox/${username}/*+`. If you do, it's also recommended |
Fredrik Luthander | e9eeeea | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 479 | you grant the users the push force permission to be able to clean up |
| 480 | stale branches. |
| 481 | |
| 482 | |
Fredrik Luthander | 8f430f1 | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 483 | [[category_forge_author]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 484 | === Forge Author |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 485 | |
| 486 | Normally Gerrit requires the author and the committer identity |
| 487 | lines in a Git commit object (or tagger line in an annotated tag) to |
| 488 | match one of the registered email addresses of the uploading user. |
Fredrik Luthander | 8f430f1 | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 489 | This permission allows users to bypass parts of that validation, which |
| 490 | may be necessary when mirroring changes from an upstream project. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 491 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 492 | Permits the use of an unverified author line in commit objects. |
| 493 | This can be useful when applying patches received by email from |
| 494 | 3rd parties, when cherry-picking changes written by others across |
| 495 | branches, or when amending someone else's commit to fix up a minor |
| 496 | problem before submitting. |
Fredrik Luthander | 8f430f1 | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 497 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 498 | By default this is granted to `Registered Users` in all projects, |
| 499 | but a site administrator may disable it if verified authorship |
| 500 | is required. |
| 501 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 502 | |
Fredrik Luthander | 8f430f1 | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 503 | [[category_forge_committer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 504 | === Forge Committer |
Fredrik Luthander | 8f430f1 | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 505 | |
| 506 | Normally Gerrit requires the author and the committer identity |
| 507 | lines in a Git commit object (or tagger line in an annotated tag) to |
| 508 | match one of the registered email addresses of the uploading user. |
| 509 | This permission allows users to bypass parts of that validation, which |
| 510 | may be necessary when mirroring changes from an upstream project. |
| 511 | |
| 512 | Allows the use of an unverified committer line in commit objects, or an |
| 513 | unverified tagger line in annotated tag objects. Typically this is only |
| 514 | required when mirroring commits from an upstream project repository. |
| 515 | |
| 516 | |
| 517 | [[category_forge_server]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 518 | === Forge Server |
Fredrik Luthander | 8f430f1 | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 519 | |
| 520 | Normally Gerrit requires the author and the committer identity |
| 521 | lines in a Git commit object (or tagger line in an annotated tag) to |
| 522 | match one of the registered email addresses of the uploading user. |
| 523 | This permission allows users to bypass parts of that validation, which |
| 524 | may be necessary when mirroring changes from an upstream project. |
| 525 | |
| 526 | Allows the use of the server's own name and email on the committer |
| 527 | line of a new commit object. This should only be necessary when force |
| 528 | pushing a commit history which has been rewritten by 'git filter-branch' |
| 529 | and that contains merge commits previously created by this Gerrit Code |
| 530 | Review server. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 531 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 532 | |
| 533 | [[category_owner]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 534 | === Owner |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 535 | |
| 536 | The `Owner` category controls which groups can modify the project's |
| 537 | configuration. Users who are members of an owner group can: |
| 538 | |
| 539 | * Change the project description |
Fredrik Luthander | 9c94938 | 2014-03-22 09:19:45 -0700 | [diff] [blame] | 540 | * Create a branch via the ssh command link:cmd-create-branch.html['create-branch'] |
Mani Chandel | 7ec4ac7 | 2013-12-10 14:50:33 +0530 | [diff] [blame] | 541 | * Create/delete a branch through the web UI |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 542 | * Grant/revoke any access rights, including `Owner` |
| 543 | |
Mani Chandel | 7ec4ac7 | 2013-12-10 14:50:33 +0530 | [diff] [blame] | 544 | To get SSH branch access project owners must grant an access right to a group |
| 545 | they are a member of, just like for any other user. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 546 | |
| 547 | Ownership over a particular branch subspace may be delegated by |
| 548 | entering a branch pattern. To delegate control over all branches |
| 549 | that begin with `qa/` to the QA group, add `Owner` category |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 550 | for reference `+refs/heads/qa/*+`. Members of the QA group can |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 551 | further refine access, but only for references that begin with |
Fredrik Luthander | 8fa3d26 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 552 | `refs/heads/qa/`. See <<project_owners,project owners>> to find |
| 553 | out more about this role. |
| 554 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 555 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 556 | [[category_push]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 557 | === Push |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 558 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 559 | This category controls how users are allowed to upload new commits |
| 560 | to projects in Gerrit. It can either give permission to push |
| 561 | directly into a branch, bypassing any code review process |
| 562 | that would otherwise be used. Or it may give permission to upload |
| 563 | new changes for code review, this depends on which namespace the |
| 564 | permission is granted to. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 565 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 566 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 567 | [[category_push_direct]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 568 | ==== Direct Push |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 569 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 570 | Any existing branch can be fast-forwarded to a new commit. |
Robin Rosenberg | 524a303 | 2012-10-14 14:24:36 +0200 | [diff] [blame] | 571 | Creation of new branches is controlled by the |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 572 | link:access-control.html#category_create['Create Reference'] |
| 573 | category. Deletion of existing branches is rejected. This is the |
| 574 | safest mode as commits cannot be discarded. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 575 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 576 | * Force option |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 577 | + |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 578 | Allows an existing branch to be deleted. Since a force push is |
| 579 | effectively a delete immediately followed by a create, but performed |
| 580 | atomically on the server and logged, this option also permits forced |
| 581 | push updates to branches. Enabling this option allows existing commits |
| 582 | to be discarded from a project history. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 583 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 584 | The push category is primarily useful for projects that only want to |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 585 | take advantage of Gerrit's access control features and do not need |
| 586 | its code review functionality. Projects that need to require code |
| 587 | reviews should not grant this category. |
| 588 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 589 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 590 | [[category_push_review]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 591 | ==== Upload To Code Review |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 592 | |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 593 | The `Push` access right granted on the namespace |
| 594 | `refs/for/refs/heads/BRANCH` permits the user to upload a non-merge |
| 595 | commit to the project's `refs/for/BRANCH` namespace, creating a new |
| 596 | change for code review. |
| 597 | |
| 598 | A user must be able to clone or fetch the project in order to create |
| 599 | a new commit on their local system, so in practice they must also |
| 600 | have the `Read` access granted to upload a change. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 601 | |
| 602 | For an open source, public Gerrit installation, it is common to |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 603 | grant `Read` and `Push` for `+refs/for/refs/heads/*+` |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 604 | to `Registered Users` in the `All-Projects` ACL. For more |
| 605 | private installations, its common to simply grant `Read` and |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 606 | `Push` for `+refs/for/refs/heads/*+` to all users of a project. |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 607 | |
| 608 | * Force option |
| 609 | + |
| 610 | The force option has no function when granted to a branch in the |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 611 | `+refs/for/refs/heads/*+` namespace. |
Fredrik Luthander | ea13ca5 | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 612 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 613 | |
Fredrik Luthander | bf56857 | 2012-01-18 11:17:00 +0100 | [diff] [blame] | 614 | [[category_push_merge]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 615 | === Push Merge Commits |
Fredrik Luthander | bf56857 | 2012-01-18 11:17:00 +0100 | [diff] [blame] | 616 | |
Magnus Bäck | 282c102 | 2012-04-18 15:39:17 -0400 | [diff] [blame] | 617 | The `Push Merge Commit` access right permits the user to upload merge |
Gustaf Lundh | a28a1d2 | 2013-05-08 15:05:12 +0100 | [diff] [blame] | 618 | commits. It's an add-on to the <<category_push,Push>> access right, and |
Magnus Bäck | 282c102 | 2012-04-18 15:39:17 -0400 | [diff] [blame] | 619 | so it won't be sufficient with only `Push Merge Commit` granted for a |
| 620 | push to happen. Some projects wish to restrict merges to being created |
| 621 | by Gerrit. By granting `Push` without `Push Merge Commit`, the only |
Edwin Kempin | aef5d6e | 2012-01-24 09:04:54 +0100 | [diff] [blame] | 622 | merges that enter the system will be those created by Gerrit. |
Fredrik Luthander | bf56857 | 2012-01-18 11:17:00 +0100 | [diff] [blame] | 623 | |
Jonathan Nieder | daf8bd4 | 2013-10-01 15:06:14 -0700 | [diff] [blame] | 624 | The reference name connected to a `Push Merge Commit` entry must always |
| 625 | be prefixed with `refs/for/`, for example `refs/for/refs/heads/BRANCH`. |
| 626 | This applies even for an entry that complements a `Push` entry for |
| 627 | `refs/heads/BRANCH` that allows direct pushes of non-merge commits, and |
| 628 | the intention of the `Push Merge Commit` entry is to allow direct pushes |
| 629 | of merge commits. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 630 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 631 | |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 632 | [[category_push_annotated]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 633 | === Push Annotated Tag |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 634 | |
David Pursehouse | 690cebe | 2012-12-12 19:22:45 +0900 | [diff] [blame] | 635 | This category permits users to push an annotated tag object into the |
| 636 | project's repository. Typically this would be done with a command line |
| 637 | such as: |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 638 | |
| 639 | ==== |
| 640 | git push ssh://USER@HOST:PORT/PROJECT tag v1.0 |
| 641 | ==== |
| 642 | |
David Pursehouse | 690cebe | 2012-12-12 19:22:45 +0900 | [diff] [blame] | 643 | Or: |
| 644 | |
| 645 | ==== |
| 646 | git push https://HOST/PROJECT tag v1.0 |
| 647 | ==== |
| 648 | |
David Pursehouse | b429ce1 | 2012-12-12 11:04:40 +0900 | [diff] [blame] | 649 | Tags must be annotated (created with `git tag -a`), should exist in |
| 650 | the `refs/tags/` namespace, and should be new. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 651 | |
| 652 | This category is intended to be used to publish tags when a project |
| 653 | reaches a stable release point worth remembering in history. |
| 654 | |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 655 | It allows for a new annotated (unsigned) tag to be created. The |
| 656 | tagger email address must be verified for the current user. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 657 | |
| 658 | To push tags created by users other than the current user (such |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 659 | as tags mirrored from an upstream project), `Forge Committer Identity` |
| 660 | must be also granted in addition to `Push Annotated Tag`. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 661 | |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 662 | To push lightweight (non annotated) tags, grant |
| 663 | <<category_create,`Create Reference`>> for reference name |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 664 | `+refs/tags/*+`, as lightweight tags are implemented just like |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 665 | branches in Git. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 666 | |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 667 | To delete or overwrite an existing tag, grant `Push` with the force |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 668 | option enabled for reference name `+refs/tags/*+`, as deleting a tag |
Fredrik Luthander | d774986 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 669 | requires the same permission as deleting a branch. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 670 | |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 671 | |
David Pursehouse | b429ce1 | 2012-12-12 11:04:40 +0900 | [diff] [blame] | 672 | [[category_push_signed]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 673 | === Push Signed Tag |
David Pursehouse | b429ce1 | 2012-12-12 11:04:40 +0900 | [diff] [blame] | 674 | |
David Pursehouse | 690cebe | 2012-12-12 19:22:45 +0900 | [diff] [blame] | 675 | This category permits users to push a PGP signed tag object into the |
| 676 | project's repository. Typically this would be done with a command |
| 677 | line such as: |
David Pursehouse | b429ce1 | 2012-12-12 11:04:40 +0900 | [diff] [blame] | 678 | |
| 679 | ==== |
| 680 | git push ssh://USER@HOST:PORT/PROJECT tag v1.0 |
| 681 | ==== |
| 682 | |
David Pursehouse | 690cebe | 2012-12-12 19:22:45 +0900 | [diff] [blame] | 683 | Or: |
| 684 | |
| 685 | ==== |
| 686 | git push https://HOST/PROJECT tag v1.0 |
| 687 | ==== |
| 688 | |
David Pursehouse | b429ce1 | 2012-12-12 11:04:40 +0900 | [diff] [blame] | 689 | Tags must be signed (created with `git tag -s`), should exist in the |
| 690 | `refs/tags/` namespace, and should be new. |
| 691 | |
| 692 | |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 693 | [[category_read]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 694 | === Read |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 695 | |
| 696 | The `Read` category controls visibility to the project's |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 697 | changes, comments, code diffs, and Git access over SSH or HTTP. |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 698 | A user must have this access granted in order to see a project, its |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 699 | changes, or any of its data. |
| 700 | |
| 701 | This category has a special behavior, where the per-project ACL is |
| 702 | evaluated before the global all projects ACL. If the per-project |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 703 | ACL has granted `Read` with 'DENY', and does not otherwise grant |
| 704 | `Read` with 'ALLOW', then a `Read` in the all projects ACL |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 705 | is ignored. This behavior is useful to hide a handful of projects |
| 706 | on an otherwise public server. |
| 707 | |
| 708 | For an open source, public Gerrit installation it is common to grant |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 709 | `Read` to `Anonymous Users` in the `All-Projects` ACL, enabling |
| 710 | casual browsing of any project's changes, as well as fetching any |
| 711 | project's repository over SSH or HTTP. New projects can be |
| 712 | temporarily hidden from public view by granting `Read` with 'DENY' |
| 713 | to `Anonymous Users` and granting `Read` to the project owner's |
| 714 | group within the per-project ACL. |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 715 | |
| 716 | For a private Gerrit installation using a trusted HTTP authentication |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 717 | source, granting `Read` to `Registered Users` may be more |
Fredrik Luthander | db7679a | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 718 | typical, enabling read access only to those users who have been |
| 719 | able to authenticate through the HTTP access controls. This may |
| 720 | be suitable in a corporate deployment if the HTTP access control |
| 721 | is already restricted to the correct set of users. |
| 722 | |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 723 | |
Edwin Kempin | fd330fc | 2012-05-09 21:09:55 +0200 | [diff] [blame] | 724 | [[category_rebase]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 725 | === Rebase |
Edwin Kempin | fd330fc | 2012-05-09 21:09:55 +0200 | [diff] [blame] | 726 | |
| 727 | This category permits users to rebase changes via the web UI by pushing |
| 728 | the `Rebase Change` button. |
| 729 | |
| 730 | The change owner and submitters can always rebase changes in the web UI |
| 731 | (even without having the `Rebase` access right assigned). |
| 732 | |
| 733 | Users without this access right who are able to upload new patch sets |
| 734 | can still do the rebase locally and upload the rebased commit as a new |
| 735 | patch set. |
| 736 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 737 | |
Chad Horohoe | c626f3c | 2012-09-13 11:04:20 -0700 | [diff] [blame] | 738 | [[category_remove_reviewer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 739 | === Remove Reviewer |
Chad Horohoe | c626f3c | 2012-09-13 11:04:20 -0700 | [diff] [blame] | 740 | |
| 741 | This category permits users to remove other users from the list of |
| 742 | reviewers on a change. |
| 743 | |
David Pursehouse | b3d1383 | 2014-12-04 14:50:37 +0900 | [diff] [blame] | 744 | Change owners can always remove reviewers who have given a zero or positive |
| 745 | score (even without having the `Remove Reviewer` access right assigned). |
| 746 | |
| 747 | Project owners and site administrators can always remove any reviewer (even |
| 748 | without having the `Remove Reviewer` access right assigned). |
Chad Horohoe | c626f3c | 2012-09-13 11:04:20 -0700 | [diff] [blame] | 749 | |
| 750 | Users without this access right can only remove themselves from the |
| 751 | reviewer list on a change. |
| 752 | |
Edwin Kempin | fd330fc | 2012-05-09 21:09:55 +0200 | [diff] [blame] | 753 | |
Fredrik Luthander | 5ccf2e4 | 2013-05-08 01:06:25 +0200 | [diff] [blame] | 754 | [[category_review_labels]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 755 | === Review Labels |
Fredrik Luthander | 5ccf2e4 | 2013-05-08 01:06:25 +0200 | [diff] [blame] | 756 | |
| 757 | For every configured label `My-Name` in the project, there is a |
| 758 | corresponding permission `label-My-Name` with a range corresponding to |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 759 | the defined values. There is also a corresponding `labelAs-My-Name` |
| 760 | permission that enables editing another user's label. |
Fredrik Luthander | 5ccf2e4 | 2013-05-08 01:06:25 +0200 | [diff] [blame] | 761 | |
| 762 | Gerrit comes pre-configured with a default 'Code-Review' label that can |
| 763 | be granted to groups within projects, enabling functionality for that |
| 764 | group's members. link:config-labels.html[Custom labels] may also be |
| 765 | defined globally or on a per-project basis. |
| 766 | |
| 767 | |
Fredrik Luthander | 5e1b51b | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 768 | [[category_submit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 769 | === Submit |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 770 | |
David Pursehouse | 6bf46ed | 2015-02-04 20:31:23 +0900 | [diff] [blame] | 771 | This category permits users to submit changes. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 772 | |
| 773 | Submitting a change causes it to be merged into the destination |
| 774 | branch as soon as possible, making it a permanent part of the |
David Pursehouse | 22bd6f9 | 2014-02-20 21:11:01 +0900 | [diff] [blame] | 775 | project's history. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 776 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 777 | In order to submit, all labels (such as `Verified` and `Code-Review`, |
| 778 | above) must enable submit, and also must not block it. See above for |
| 779 | details on each label. |
Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 780 | |
Edwin Kempin | bfa0621 | 2013-04-04 16:06:39 +0200 | [diff] [blame] | 781 | To link:user-upload.html#auto_merge[immediately submit a change on push] |
| 782 | the caller needs to have the Submit permission on `refs/for/<ref>` |
| 783 | (e.g. on `refs/for/refs/heads/master`). |
| 784 | |
David Pursehouse | 22bd6f9 | 2014-02-20 21:11:01 +0900 | [diff] [blame] | 785 | [[category_submit_on_behalf_of]] |
| 786 | === Submit (On Behalf Of) |
| 787 | |
| 788 | This category permits users who have also been granted the `Submit` |
| 789 | permission to submit changes on behalf of another user. |
| 790 | |
| 791 | Note that this permission is named `submitAs` in the `project.config` |
| 792 | file. |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 793 | |
David Pursehouse | 5ae7300 | 2012-11-01 15:22:26 +0900 | [diff] [blame] | 794 | [[category_view_drafts]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 795 | === View Drafts |
David Pursehouse | 5ae7300 | 2012-11-01 15:22:26 +0900 | [diff] [blame] | 796 | |
| 797 | This category permits users to view draft changes uploaded by other |
| 798 | users. |
| 799 | |
| 800 | The change owner and any explicitly added reviewers can always see |
| 801 | draft changes (even without having the `View Drafts` access right |
| 802 | assigned). |
| 803 | |
| 804 | |
David Pursehouse | be7f458 | 2012-12-12 11:21:29 +0900 | [diff] [blame] | 805 | [[category_publish_drafts]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 806 | === Publish Drafts |
David Pursehouse | be7f458 | 2012-12-12 11:21:29 +0900 | [diff] [blame] | 807 | |
| 808 | This category permits users to publish draft changes uploaded by other |
| 809 | users. |
| 810 | |
| 811 | The change owner can always publish draft changes (even without having |
| 812 | the `Publish Drafts` access right assigned). |
| 813 | |
| 814 | |
| 815 | [[category_delete_drafts]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 816 | === Delete Drafts |
David Pursehouse | be7f458 | 2012-12-12 11:21:29 +0900 | [diff] [blame] | 817 | |
| 818 | This category permits users to delete draft changes uploaded by other |
| 819 | users. |
| 820 | |
| 821 | The change owner can always delete draft changes (even without having |
| 822 | the `Delete Drafts` access right assigned). |
| 823 | |
| 824 | |
David Pursehouse | 59aee36 | 2012-11-15 17:25:17 +0900 | [diff] [blame] | 825 | [[category_edit_topic_name]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 826 | === Edit Topic Name |
David Pursehouse | 59aee36 | 2012-11-15 17:25:17 +0900 | [diff] [blame] | 827 | |
| 828 | This category permits users to edit the topic name of a change that |
| 829 | is uploaded for review. |
| 830 | |
| 831 | The change owner, branch owners, project owners, and site administrators |
| 832 | can always edit the topic name (even without having the `Edit Topic Name` |
| 833 | access right assigned). |
| 834 | |
Edwin Kempin | 1f77b53 | 2013-11-08 07:16:31 +0100 | [diff] [blame] | 835 | Whether the topic can be edited on closed changes can be controlled |
| 836 | by the 'Force Edit' flag. If this flag is not set the topic can only be |
| 837 | edited on open changes. |
| 838 | |
David Pursehouse | 59aee36 | 2012-11-15 17:25:17 +0900 | [diff] [blame] | 839 | |
David Pursehouse | de71170 | 2014-09-10 16:23:34 +0200 | [diff] [blame] | 840 | [[category_edit_hashtags]] |
| 841 | === Edit Hashtags |
| 842 | |
| 843 | This category permits users to add or remove hashtags on a change that |
| 844 | is uploaded for review. |
| 845 | |
| 846 | The change owner, branch owners, project owners, and site administrators |
| 847 | can always edit or remove hashtags (even without having the `Edit Hashtags` |
| 848 | access right assigned). |
| 849 | |
| 850 | |
Edwin Kempin | 4bf0196 | 2014-04-16 16:47:10 +0200 | [diff] [blame] | 851 | [[example_roles]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 852 | == Examples of typical roles in a project |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 853 | |
| 854 | Below follows a set of typical roles on a server and which access |
| 855 | rights these roles typically should be granted. You may see them as |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 856 | general guidelines for a typical way to set up your project on a |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 857 | brand new Gerrit instance. |
| 858 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 859 | |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 860 | [[examples_contributor]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 861 | === Contributor |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 862 | |
| 863 | This is the typical user on a public server. They are able to read |
| 864 | your project and upload new changes to it. They are able to give |
| 865 | feedback on other changes as well, but are unable to block or approve |
| 866 | any changes. |
| 867 | |
| 868 | Suggested access rights to grant: |
| 869 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 870 | * xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*' |
| 871 | * xref:category_push[`Push`] to 'refs/for/refs/heads/*' |
| 872 | * link:config-labels.html#label_Code-Review[`Code-Review`] with range '-1' to '+1' for 'refs/heads/*' |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 873 | |
Fredrik Luthander | d6c5925 | 2014-03-17 00:56:04 +0100 | [diff] [blame] | 874 | If it's desired to have the possibility to upload temporarily hidden |
| 875 | changes there's a specific permission for that. This enables someone |
| 876 | to add specific reviewers for early feedback before making the change |
| 877 | publically visible. If you want to allow others than the owners to |
| 878 | publish a draft you also need to grant them `Publish Drafts`. |
| 879 | |
| 880 | Optional access rights to grant: |
| 881 | |
| 882 | * xref:category_push[`Push`] to 'refs/drafts/*' |
| 883 | * xref:category_publish_drafts[`Publish Drafts`] to 'refs/heads/*' |
| 884 | |
Fredrik Luthander | bc75ef7 | 2012-01-26 15:57:08 +0100 | [diff] [blame] | 885 | |
Fredrik Luthander | 654161c | 2012-01-31 14:42:36 +0100 | [diff] [blame] | 886 | [[examples_developer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 887 | === Developer |
Fredrik Luthander | 654161c | 2012-01-31 14:42:36 +0100 | [diff] [blame] | 888 | |
| 889 | This is the typical core developer on a public server. They are able |
| 890 | to read the project, upload changes to a branch. They are allowed to |
| 891 | push merge commits to merge branches together. Also, they are allowed |
| 892 | to forge author identity, thus handling commits belonging to others |
| 893 | than themselves, effectively allowing them to transfer commits |
| 894 | between different branches. |
| 895 | |
| 896 | They are furthermore able to code review and verify commits, and |
| 897 | eventually submit them. If you have an automated CI system that |
| 898 | builds all uploaded patch sets you might want to skip the |
| 899 | verification rights for the developer and let the CI system do that |
| 900 | exclusively. |
| 901 | |
| 902 | Suggested access rights to grant: |
| 903 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 904 | * xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*' |
| 905 | * xref:category_push[`Push`] to 'refs/for/refs/heads/*' |
| 906 | * xref:category_push_merge[`Push merge commit`] to 'refs/for/refs/heads/*' |
| 907 | * xref:category_forge_author[`Forge Author Identity`] to 'refs/heads/*' |
| 908 | * link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-2' to '+2' for 'refs/heads/*' |
Peter Jönsson | 3bfcae7 | 2013-07-17 22:06:32 +0200 | [diff] [blame] | 909 | * link:config-labels.html#label_Verified[`Label: Verified`] with range '-1' to '+1' for 'refs/heads/*' |
Edwin Kempin | 7b1897c | 2015-04-16 15:13:44 +0200 | [diff] [blame] | 910 | * xref:category_submit[`Submit`] on 'refs/heads/*' |
Fredrik Luthander | 654161c | 2012-01-31 14:42:36 +0100 | [diff] [blame] | 911 | |
| 912 | If the project is small or the developers are seasoned it might make |
| 913 | sense to give them the freedom to push commits directly to a branch. |
| 914 | |
| 915 | Optional access rights to grant: |
| 916 | |
| 917 | * <<category_push,`Push`>> to 'refs/heads/*' |
| 918 | * <<category_push_merge,`Push merge commit`>> to 'refs/heads/*' |
| 919 | |
| 920 | |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 921 | [[examples_cisystem]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 922 | === CI system |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 923 | |
Gustaf Lundh | a28a1d2 | 2013-05-08 15:05:12 +0100 | [diff] [blame] | 924 | A typical Continuous Integration system should be able to download new changes |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 925 | to build and then leave a verdict somehow. |
| 926 | |
| 927 | As an example, the popular |
| 928 | link:https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger[gerrit-trigger plugin] |
| 929 | for Jenkins/Hudson can set labels at: |
| 930 | |
| 931 | * The start of a build |
| 932 | * A successful build |
| 933 | * An unstable build (tests fails) |
| 934 | * A failed build |
| 935 | |
Peter Jönsson | 3bfcae7 | 2013-07-17 22:06:32 +0200 | [diff] [blame] | 936 | Usually the range chosen for this verdict is the `Verified` label. Depending on |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 937 | the size of your project and discipline of involved developers you might want |
Peter Jönsson | 3bfcae7 | 2013-07-17 22:06:32 +0200 | [diff] [blame] | 938 | to limit access right to the +1 `Verified` label to the CI system only. That |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 939 | way it's guaranteed that submitted commits always get built and pass tests |
| 940 | successfully. |
| 941 | |
| 942 | If the build doesn't complete successfully the CI system can set the |
Peter Jönsson | 3bfcae7 | 2013-07-17 22:06:32 +0200 | [diff] [blame] | 943 | `Verified` label to -1. However that means that a failed build will block |
| 944 | submit of the change even if someone else sets `Verified` +1. Depending on the |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 945 | project and how much the CI system can be trusted for accurate results, a |
| 946 | blocking label might not be feasible. A recommended alternative is to set the |
| 947 | label `Code-review` to -1 instead, as it isn't a blocking label but still |
David Pursehouse | 221d4f6 | 2012-06-08 17:38:08 +0900 | [diff] [blame] | 948 | shows a red label in the Gerrit UI. Optionally, to enable the possibility to |
| 949 | deliver different results (build error vs unstable for instance), it's also |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 950 | possible to set `Code-review` +1 as well. |
| 951 | |
Edwin Kempin | a2e13cf | 2012-03-30 09:02:36 +0200 | [diff] [blame] | 952 | If pushing new changes is granted, it's possible to automate cherry-pick of |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 953 | submitted changes for upload to other branches under certain conditions. This |
| 954 | is probably not the first step of what a project wants to automate however, |
| 955 | and so the push right can be found under the optional section. |
| 956 | |
| 957 | Suggested access rights to grant, that won't block changes: |
| 958 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 959 | * xref:category_read[`Read`] on 'refs/heads/\*' and 'refs/tags/*' |
| 960 | * link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '0' for 'refs/heads/*' |
Peter Jönsson | 3bfcae7 | 2013-07-17 22:06:32 +0200 | [diff] [blame] | 961 | * link:config-labels.html#label_Verified[`Label: Verified`] with range '0' to '+1' for 'refs/heads/*' |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 962 | |
| 963 | Optional access rights to grant: |
| 964 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 965 | * link:config-labels.html#label_Code-Review[`Label: Code-Review`] with range '-1' to '+1' for 'refs/heads/*' |
| 966 | * xref:category_push[`Push`] to 'refs/for/refs/heads/*' |
Fredrik Luthander | f2105be | 2012-01-27 12:44:05 +0100 | [diff] [blame] | 967 | |
| 968 | |
Fredrik Luthander | fe72002 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 969 | [[examples_integrator]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 970 | === Integrator |
Fredrik Luthander | fe72002 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 971 | |
| 972 | Integrators are like developers but with some additional rights granted due |
| 973 | to their administrative role in a project. They can upload or push any commit |
| 974 | with any committer email (not just their own) and they can also create new |
| 975 | tags and branches. |
| 976 | |
| 977 | Suggested access rights to grant: |
| 978 | |
| 979 | * <<examples_developer,Developer rights>> |
| 980 | * <<category_push,`Push`>> to 'refs/heads/*' |
| 981 | * <<category_push_merge,`Push merge commit`>> to 'refs/heads/*' |
Fredrik Luthander | 404a285 | 2012-10-10 08:51:22 +0200 | [diff] [blame] | 982 | * <<category_forge_committer,`Forge Committer Identity`>> to 'refs/for/refs/heads/*' |
Fredrik Luthander | fe72002 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 983 | * <<category_create,`Create Reference`>> to 'refs/heads/*' |
| 984 | * <<category_push_annotated,`Push Annotated Tag`>> to 'refs/tags/*' |
| 985 | |
| 986 | |
Fredrik Luthander | 9c64536 | 2012-03-22 18:10:42 +0100 | [diff] [blame] | 987 | [[examples_project-owner]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 988 | === Project owner |
Fredrik Luthander | 9c64536 | 2012-03-22 18:10:42 +0100 | [diff] [blame] | 989 | |
| 990 | The project owner is almost like an integrator but with additional destructive |
| 991 | power in the form of being able to delete branches. Optionally these users |
| 992 | also have the power to configure access rights in gits assigned to them. |
| 993 | |
| 994 | [WARNING] |
Gustaf Lundh | a28a1d2 | 2013-05-08 15:05:12 +0100 | [diff] [blame] | 995 | These users should be really knowledgeable about git, for instance knowing why |
Fredrik Luthander | 9c64536 | 2012-03-22 18:10:42 +0100 | [diff] [blame] | 996 | tags never should be removed from a server. This role is granted potentially |
| 997 | destructive access rights and cleaning up after such a mishap could be time |
| 998 | consuming! |
| 999 | |
| 1000 | Suggested access rights to grant: |
| 1001 | |
| 1002 | * <<examples_integrator,Integrator rights>> |
| 1003 | * <<category_push,`Push`>> with the force option to 'refs/heads/\*' and 'refs/tags/*' |
| 1004 | |
| 1005 | Optional access right to grant: |
| 1006 | |
| 1007 | * <<category_owner,`Owner`>> in the gits they mostly work with. |
| 1008 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1009 | |
Fredrik Luthander | 5a8e7d8 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 1010 | [[examples_administrator]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1011 | === Administrator |
Fredrik Luthander | 5a8e7d8 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 1012 | |
| 1013 | The administrator role is the most powerful role known in the Gerrit universe. |
Fredrik Luthander | b8eaa08 | 2014-03-17 01:02:22 +0100 | [diff] [blame] | 1014 | This role may grant itself (or others) any access right. By default the |
Fredrik Luthander | 5a8e7d8 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 1015 | <<administrators,`Administrators` group>> is the group that has this role. |
| 1016 | |
| 1017 | Mandatory access rights: |
| 1018 | |
| 1019 | * <<capability_administrateServer,The `Administrate Server` capability>> |
| 1020 | |
| 1021 | Suggested access rights to grant: |
| 1022 | |
Fredrik Luthander | b8eaa08 | 2014-03-17 01:02:22 +0100 | [diff] [blame] | 1023 | * <<examples_project-owner,`Project owner rights`>> |
| 1024 | * Any <<global_capabilities,`capabilities`>> needed by the administrator |
Fredrik Luthander | 5a8e7d8 | 2012-03-22 17:29:39 +0100 | [diff] [blame] | 1025 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1026 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1027 | == Enforcing site wide access policies |
Sasa Zivkov | d589f46 | 2013-02-12 14:27:09 +0100 | [diff] [blame] | 1028 | |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 1029 | By granting the <<category_owner,`Owner`>> access right on the `+refs/*+` to a |
Sasa Zivkov | d589f46 | 2013-02-12 14:27:09 +0100 | [diff] [blame] | 1030 | group, Gerrit administrators can delegate the responsibility of maintaining |
| 1031 | access rights for that project to that group. |
| 1032 | |
| 1033 | In a corporate deployment it is often necessary to enforce some access |
| 1034 | policies. An example could be that no-one can update or delete a tag, not even |
| 1035 | the project owners. The 'ALLOW' and 'DENY' rules are not enough for this |
| 1036 | purpose as project owners can grant themselves any access right they wish and, |
| 1037 | thus, effectively override any inherited access rights from the |
| 1038 | "`All-Projects`" or some other common parent project. |
| 1039 | |
| 1040 | What is needed is a mechanism to block a permission in a parent project so |
| 1041 | that even project owners cannot allow a blocked permission in their child |
| 1042 | project. Still, project owners should retain the possibility to manage all |
| 1043 | non-blocked rules as they wish. This gives best of both worlds: |
| 1044 | |
| 1045 | * Gerrit administrators can concentrate on enforcing site wide policies |
| 1046 | and providing a meaningful set of default access permissions |
| 1047 | * Project owners can manage access rights of their projects without a danger |
| 1048 | of violating a site wide policy |
| 1049 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1050 | |
Edwin Kempin | 60ab853 | 2013-03-27 14:33:46 +0100 | [diff] [blame] | 1051 | [[block]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1052 | === 'BLOCK' access rule |
Sasa Zivkov | d589f46 | 2013-02-12 14:27:09 +0100 | [diff] [blame] | 1053 | |
| 1054 | The 'BLOCK' rule blocks a permission globally. An inherited 'BLOCK' rule cannot |
Sasa Zivkov | cff084b | 2013-01-15 18:52:32 +0100 | [diff] [blame] | 1055 | be overridden in the inheriting project. Any 'ALLOW' rule, from a different |
| 1056 | access section or from an inheriting project, which conflicts with an |
| 1057 | inherited 'BLOCK' rule will not be honored. Searching for 'BLOCK' rules, in |
Sasa Zivkov | d589f46 | 2013-02-12 14:27:09 +0100 | [diff] [blame] | 1058 | the chain of parent projects, ignores the Exclusive flag that is normally |
| 1059 | applied to access sections. |
| 1060 | |
| 1061 | A 'BLOCK' rule that blocks the 'push' permission blocks any type of push, |
| 1062 | force or not. A blocking force push rule blocks only force pushes, but |
| 1063 | allows non-forced pushes if an 'ALLOW' rule would have permitted it. |
| 1064 | |
| 1065 | It is also possible to block label ranges. To block a group 'X' from voting |
| 1066 | '-2' and '+2', but keep their existing voting permissions for the '-1..+1' |
| 1067 | range intact we would define: |
| 1068 | |
| 1069 | ==== |
| 1070 | [access "refs/heads/*"] |
| 1071 | label-Code-Review = block -2..+2 group X |
| 1072 | ==== |
| 1073 | |
| 1074 | The interpretation of the 'min..max' range in case of a blocking rule is: block |
| 1075 | every vote from '-INFINITE..min' and 'max..INFINITE'. For the example above it |
| 1076 | means that the range '-1..+1' is not affected by this block. |
| 1077 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1078 | === 'BLOCK' and 'ALLOW' rules in the same access section |
Sasa Zivkov | cff084b | 2013-01-15 18:52:32 +0100 | [diff] [blame] | 1079 | |
| 1080 | When an access section of a project contains a 'BLOCK' and an 'ALLOW' rule for |
| 1081 | the same permission then this 'ALLOW' rule overrides the 'BLOCK' rule: |
| 1082 | |
| 1083 | ==== |
| 1084 | [access "refs/heads/*"] |
| 1085 | push = block group X |
| 1086 | push = group Y |
| 1087 | ==== |
| 1088 | |
| 1089 | In this case a user which is a member of the group 'Y' will still be allowed to |
| 1090 | push to 'refs/heads/*' even if it is a member of the group 'X'. |
| 1091 | |
| 1092 | NOTE: An 'ALLOW' rule overrides a 'BLOCK' rule only when both of them are |
| 1093 | inside the same access section of the same project. An 'ALLOW' rule in a |
| 1094 | different access section of the same project or in any access section in an |
| 1095 | inheriting project cannot override a 'BLOCK' rule. |
| 1096 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1097 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1098 | === Examples |
Sasa Zivkov | d589f46 | 2013-02-12 14:27:09 +0100 | [diff] [blame] | 1099 | |
| 1100 | The following examples show some possible use cases for the 'BLOCK' rules. |
| 1101 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1102 | ==== Make sure no one can update or delete a tag |
Sasa Zivkov | d589f46 | 2013-02-12 14:27:09 +0100 | [diff] [blame] | 1103 | |
| 1104 | This requirement is quite common in a corporate deployment where |
| 1105 | reproducibility of a build must be guaranteed. To achieve that we block 'push' |
| 1106 | permission for the <<anonymous_users,'Anonymous Users'>> in "`All-Projects`": |
| 1107 | |
| 1108 | ==== |
| 1109 | [access "refs/tags/*"] |
| 1110 | push = block group Anonymous Users |
| 1111 | ==== |
| 1112 | |
| 1113 | By blocking the <<anonymous_users,'Anonymous Users'>> we effectively block |
| 1114 | everyone as everyone is a member of that group. Note that the permission to |
| 1115 | create a tag is still necessary. Assuming that only <<category_owner,project |
| 1116 | owners>> are allowed to create tags, we would extend the example above: |
| 1117 | |
| 1118 | ==== |
| 1119 | [access "refs/tags/*"] |
| 1120 | push = block group Anonymous Users |
| 1121 | create = group Project Owners |
| 1122 | pushTag = group Project Owners |
| 1123 | ==== |
Fredrik Luthander | 9c64536 | 2012-03-22 18:10:42 +0100 | [diff] [blame] | 1124 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1125 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1126 | ==== Let only a dedicated group vote in a special category |
Sasa Zivkov | cff084b | 2013-01-15 18:52:32 +0100 | [diff] [blame] | 1127 | |
| 1128 | Assume there is a more restrictive process for submitting changes in stable |
| 1129 | release branches which is manifested as a new voting category |
| 1130 | 'Release-Process'. Assume we want to make sure that only a 'Release Engineers' |
| 1131 | group can vote in this category and that even project owners cannot approve |
| 1132 | this category. We have to block everyone except the 'Release Engineers' to vote |
| 1133 | in this category and, of course, allow 'Release Engineers' to vote in that |
| 1134 | category. In the "`All-Projects`" we define the following rules: |
| 1135 | |
| 1136 | ==== |
| 1137 | [access "refs/heads/stable*"] |
Gustaf Lundh | a28a1d2 | 2013-05-08 15:05:12 +0100 | [diff] [blame] | 1138 | label-Release-Process = block -1..+1 group Anonymous Users |
| 1139 | label-Release-Process = -1..+1 group Release Engineers |
Sasa Zivkov | cff084b | 2013-01-15 18:52:32 +0100 | [diff] [blame] | 1140 | ==== |
| 1141 | |
David Pursehouse | 8becc2a | 2013-04-23 18:51:04 +0900 | [diff] [blame] | 1142 | [[global_capabilities]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1143 | == Global Capabilities |
Fredrik Luthander | 80ebf9d | 2012-02-13 09:32:43 +0100 | [diff] [blame] | 1144 | |
David Pursehouse | 8becc2a | 2013-04-23 18:51:04 +0900 | [diff] [blame] | 1145 | The global capabilities control actions that the administrators of |
Fredrik Luthander | 80ebf9d | 2012-02-13 09:32:43 +0100 | [diff] [blame] | 1146 | the server can perform which usually affect the entire |
| 1147 | server in some way. The administrators may delegate these |
| 1148 | capabilities to trusted groups of users. |
| 1149 | |
| 1150 | Delegation of capabilities allows groups to be granted a subset of |
| 1151 | administrative capabilities without being given complete |
| 1152 | administrative control of the server. This makes it possible to |
| 1153 | keep fewer users in the administrators group, even while spreading |
| 1154 | much of the server administration burden out to more users. |
| 1155 | |
David Pursehouse | 8becc2a | 2013-04-23 18:51:04 +0900 | [diff] [blame] | 1156 | Global capabilities are assigned to groups in the access rights settings |
| 1157 | of the root project ("`All-Projects`"). |
| 1158 | |
Fredrik Luthander | 80ebf9d | 2012-02-13 09:32:43 +0100 | [diff] [blame] | 1159 | Below you find a list of capabilities available: |
| 1160 | |
| 1161 | |
David Pursehouse | 11c4c5f | 2013-06-09 08:07:23 +0900 | [diff] [blame] | 1162 | [[capability_accessDatabase]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1163 | === Access Database |
David Pursehouse | 11c4c5f | 2013-06-09 08:07:23 +0900 | [diff] [blame] | 1164 | |
Dave Borowitz | d9b8b39 | 2014-09-11 13:49:54 +0200 | [diff] [blame] | 1165 | Allow users to access the database using the `gsql` command, and view code |
| 1166 | review metadata refs in repositories. |
David Pursehouse | 11c4c5f | 2013-06-09 08:07:23 +0900 | [diff] [blame] | 1167 | |
| 1168 | |
Fredrik Luthander | 426885f | 2012-02-13 09:56:57 +0100 | [diff] [blame] | 1169 | [[capability_administrateServer]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1170 | === Administrate Server |
Fredrik Luthander | 426885f | 2012-02-13 09:56:57 +0100 | [diff] [blame] | 1171 | |
| 1172 | This is in effect the owner and administrator role of the Gerrit |
| 1173 | instance. Any members of a group granted this capability will be |
| 1174 | able to grant any access right to any group. They will also have all |
| 1175 | capabilities granted to them automatically. |
| 1176 | |
| 1177 | |
Bruce Zu | 4512fe6 | 2014-11-18 17:39:41 +0800 | [diff] [blame] | 1178 | [[capability_batchChangesLimit]] |
| 1179 | === Batch Changes Limit |
| 1180 | |
| 1181 | Allow site administrators to configure the batch changes limit for |
| 1182 | users to override the system config |
| 1183 | link:config-gerrit.html#receive.maxBatchChanges['receive.maxBatchChanges']. |
| 1184 | |
| 1185 | Administrators can add a global block to `All-Projects` with group(s) |
| 1186 | that should have different limits. |
| 1187 | |
| 1188 | When applying a batch changes limit to a user the largest value |
| 1189 | granted by any of their groups is used. 0 means no limit. |
| 1190 | |
| 1191 | |
Fredrik Luthander | b02afca | 2012-02-13 09:59:48 +0100 | [diff] [blame] | 1192 | [[capability_createAccount]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1193 | === Create Account |
Fredrik Luthander | b02afca | 2012-02-13 09:59:48 +0100 | [diff] [blame] | 1194 | |
Fredrik Luthander | 79d3815 | 2012-03-13 09:52:22 +0100 | [diff] [blame] | 1195 | Allow link:cmd-create-account.html[account creation over the ssh prompt]. |
Fredrik Luthander | b02afca | 2012-02-13 09:59:48 +0100 | [diff] [blame] | 1196 | This capability allows the granted group members to create non-interactive |
| 1197 | service accounts. These service accounts are generally used for automation |
| 1198 | and made to be members of the |
| 1199 | link:access-control.html#non-interactive_users['Non-Interactive users'] group. |
| 1200 | |
| 1201 | |
Fredrik Luthander | 79d3815 | 2012-03-13 09:52:22 +0100 | [diff] [blame] | 1202 | [[capability_createGroup]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1203 | === Create Group |
Fredrik Luthander | 79d3815 | 2012-03-13 09:52:22 +0100 | [diff] [blame] | 1204 | |
| 1205 | Allow group creation. Groups are used to grant users access to different |
| 1206 | actions in projects. This capability allows the granted group members to |
| 1207 | either link:cmd-create-group.html[create new groups via ssh] or via the web UI. |
| 1208 | |
| 1209 | |
| 1210 | [[capability_createProject]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1211 | === Create Project |
Fredrik Luthander | 79d3815 | 2012-03-13 09:52:22 +0100 | [diff] [blame] | 1212 | |
| 1213 | Allow project creation. This capability allows the granted group to |
| 1214 | either link:cmd-create-project.html[create new git projects via ssh] |
| 1215 | or via the web UI. |
| 1216 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1217 | |
Sasa Zivkov | 812f489 | 2012-06-21 16:25:21 +0200 | [diff] [blame] | 1218 | [[capability_emailReviewers]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1219 | === Email Reviewers |
Sasa Zivkov | 812f489 | 2012-06-21 16:25:21 +0200 | [diff] [blame] | 1220 | |
| 1221 | Allow or deny sending email to change reviewers and watchers. This can be used |
| 1222 | to deny build bots from emailing reviewers and people who watch the change. |
| 1223 | Instead, only the authors of the change and those who starred it will be |
| 1224 | emailed. The allow rules are evaluated before deny rules, however the default |
| 1225 | is to allow emailing, if no explicit rule is matched. |
Fredrik Luthander | 79d3815 | 2012-03-13 09:52:22 +0100 | [diff] [blame] | 1226 | |
Fredrik Luthander | a8aa9c5 | 2013-05-09 14:50:39 +0200 | [diff] [blame] | 1227 | |
Fredrik Luthander | 74ad0d0 | 2012-03-13 13:06:30 +0100 | [diff] [blame] | 1228 | [[capability_flushCaches]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1229 | === Flush Caches |
Fredrik Luthander | 74ad0d0 | 2012-03-13 13:06:30 +0100 | [diff] [blame] | 1230 | |
Fredrik Luthander | 4860300 | 2012-03-21 18:17:17 +0100 | [diff] [blame] | 1231 | Allow the flushing of Gerrit's caches. This capability allows the granted |
Fredrik Luthander | 74ad0d0 | 2012-03-13 13:06:30 +0100 | [diff] [blame] | 1232 | group to link:cmd-flush-caches.html[flush some or all Gerrit caches via ssh]. |
| 1233 | |
| 1234 | [NOTE] |
| 1235 | This capability doesn't imply permissions to the show-caches command. For that |
| 1236 | you need the <<capability_viewCaches,view caches capability>>. |
| 1237 | |
| 1238 | |
Fredrik Luthander | 4684302 | 2012-03-13 16:11:02 +0100 | [diff] [blame] | 1239 | [[capability_kill]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1240 | === Kill Task |
Fredrik Luthander | 4684302 | 2012-03-13 16:11:02 +0100 | [diff] [blame] | 1241 | |
| 1242 | Allow the operation of the link:cmd-kill.html[kill command over ssh]. The |
| 1243 | kill command ends tasks that currently occupy the Gerrit server, usually |
| 1244 | a replication task or a user initiated task such as an upload-pack or |
Gustaf Lundh | a28a1d2 | 2013-05-08 15:05:12 +0100 | [diff] [blame] | 1245 | receive-pack. |
Fredrik Luthander | 4684302 | 2012-03-13 16:11:02 +0100 | [diff] [blame] | 1246 | |
David Ostrovsky | aa49e27 | 2014-07-22 00:55:47 +0200 | [diff] [blame] | 1247 | [[capability_modifyAccount]] |
| 1248 | === Modify Account |
| 1249 | |
| 1250 | Allow to link:cmd-set-account.html[modify accounts over the ssh prompt]. |
| 1251 | This capability allows the granted group members to modify any user account |
| 1252 | setting. |
Fredrik Luthander | 4684302 | 2012-03-13 16:11:02 +0100 | [diff] [blame] | 1253 | |
| 1254 | [[capability_priority]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1255 | === Priority |
Fredrik Luthander | 4684302 | 2012-03-13 16:11:02 +0100 | [diff] [blame] | 1256 | |
| 1257 | This capability allows users to use |
| 1258 | link:config-gerrit.html#sshd.batchThreads[the thread pool reserved] for |
| 1259 | link:access-control.html#non-interactive_users['Non-Interactive Users']. |
| 1260 | It's a binary value in that granted users either have access to the thread |
| 1261 | pool, or they don't. |
| 1262 | |
| 1263 | There are three modes for this capability and they're listed by rising |
| 1264 | priority: |
| 1265 | |
| 1266 | No capability configured.:: |
| 1267 | The user isn't a member of a group with any priority capability granted. By |
| 1268 | default the user is then in the 'INTERACTIVE' thread pool. |
| 1269 | |
| 1270 | 'BATCH':: |
| 1271 | If there's a thread pool configured for 'Non-Interactive Users' and a user is |
| 1272 | granted the priority capability with the 'BATCH' mode selected, the user ends |
| 1273 | up in the separate batch user thread pool. This is true unless the user is |
| 1274 | also granted the below 'INTERACTIVE' option. |
| 1275 | |
| 1276 | 'INTERACTIVE':: |
| 1277 | If a user is granted the priority capability with the 'INTERACTIVE' option, |
| 1278 | regardless if they also have the 'BATCH' option or not, they are in the |
| 1279 | 'INTERACTIVE' thread pool. |
| 1280 | |
| 1281 | |
Fredrik Luthander | 80ebf9d | 2012-02-13 09:32:43 +0100 | [diff] [blame] | 1282 | [[capability_queryLimit]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1283 | === Query Limit |
Fredrik Luthander | 80ebf9d | 2012-02-13 09:32:43 +0100 | [diff] [blame] | 1284 | |
| 1285 | Allow site administrators to configure the query limit for users to |
| 1286 | be above the default hard-coded value of 500. Administrators can add |
David Pursehouse | b5d99aaf | 2013-08-09 11:02:48 +0900 | [diff] [blame] | 1287 | a global block to `All-Projects` with group(s) that should have different |
| 1288 | limits. |
Fredrik Luthander | 80ebf9d | 2012-02-13 09:32:43 +0100 | [diff] [blame] | 1289 | |
| 1290 | When applying a query limit to a user the largest value granted by |
| 1291 | any of their groups is used. |
| 1292 | |
| 1293 | This limit applies not only to the link:cmd-query.html[`gerrit query`] |
| 1294 | command, but also to the web UI results pagination size. |
| 1295 | |
| 1296 | |
Shawn Pearce | bb027b0 | 2013-06-10 14:35:39 -0700 | [diff] [blame] | 1297 | [[capability_runAs]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1298 | === Run As |
Shawn Pearce | bb027b0 | 2013-06-10 14:35:39 -0700 | [diff] [blame] | 1299 | |
Shawn Pearce | f3ffd08 | 2013-06-12 11:21:35 -0700 | [diff] [blame] | 1300 | Allow users to impersonate any other user with the `X-Gerrit-RunAs` |
| 1301 | HTTP header on REST API calls, or the link:cmd-suexec.html[suexec] |
| 1302 | SSH command. |
| 1303 | |
| 1304 | When impersonating an administrator the Administrate Server capability |
| 1305 | is not honored. This security feature tries to prevent a role with |
| 1306 | Run As capability from modifying the access controls in All-Projects, |
| 1307 | however modification may still be possible if the impersonated user |
| 1308 | has permission to push or submit changes on `refs/meta/config`. Run |
| 1309 | As also blocks using most capabilities including Create User, Run |
| 1310 | Garbage Collection, etc., unless the capability is also explicitly |
| 1311 | granted to a group the administrator is a member of. |
| 1312 | |
| 1313 | Administrators do not automatically inherit this capability; it must |
| 1314 | be explicitly granted. |
Shawn Pearce | bb027b0 | 2013-06-10 14:35:39 -0700 | [diff] [blame] | 1315 | |
| 1316 | |
Edwin Kempin | 619169b | 2012-02-09 15:47:52 +0100 | [diff] [blame] | 1317 | [[capability_runGC]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1318 | === Run Garbage Collection |
Edwin Kempin | 619169b | 2012-02-09 15:47:52 +0100 | [diff] [blame] | 1319 | |
| 1320 | Allow users to run the Git garbage collection for the repositories of |
| 1321 | all projects. |
| 1322 | |
| 1323 | |
Ed Bartosh | d168b81 | 2013-04-13 20:15:58 +0300 | [diff] [blame] | 1324 | [[capability_streamEvents]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1325 | === Stream Events |
Ed Bartosh | d168b81 | 2013-04-13 20:15:58 +0300 | [diff] [blame] | 1326 | |
| 1327 | Allow performing streaming of Gerrit events. This capability |
| 1328 | allows the granted group to |
| 1329 | link:cmd-stream-events.html[stream Gerrit events via ssh]. |
| 1330 | |
| 1331 | |
Dave Borowitz | f3548a9 | 2014-02-20 11:02:19 -0800 | [diff] [blame] | 1332 | [[capability_viewAllAccounts]] |
| 1333 | === View All Accounts |
| 1334 | |
| 1335 | Allow viewing all accounts for purposes of auto-completion, regardless |
| 1336 | of link:config-gerrit.html#accounts.visibility[accounts.visibility] |
| 1337 | setting. |
| 1338 | |
| 1339 | |
Fredrik Luthander | 9c7da66 | 2012-03-13 17:49:27 +0100 | [diff] [blame] | 1340 | [[capability_viewCaches]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1341 | === View Caches |
Fredrik Luthander | 9c7da66 | 2012-03-13 17:49:27 +0100 | [diff] [blame] | 1342 | |
Fredrik Luthander | 4860300 | 2012-03-21 18:17:17 +0100 | [diff] [blame] | 1343 | Allow querying for status of Gerrit's internal caches. This capability allows |
Fredrik Luthander | 9c7da66 | 2012-03-13 17:49:27 +0100 | [diff] [blame] | 1344 | the granted group to |
| 1345 | link:cmd-show-caches.html[look at some or all Gerrit caches via ssh]. |
| 1346 | |
| 1347 | |
Fredrik Luthander | 4860300 | 2012-03-21 18:17:17 +0100 | [diff] [blame] | 1348 | [[capability_viewConnections]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1349 | === View Connections |
Fredrik Luthander | 4860300 | 2012-03-21 18:17:17 +0100 | [diff] [blame] | 1350 | |
| 1351 | Allow querying for status of Gerrit's current client connections. This |
| 1352 | capability allows the granted group to |
| 1353 | link:cmd-show-connections.html[look at Gerrit's current connections via ssh]. |
| 1354 | |
| 1355 | |
Edwin Kempin | 362b14d1 | 2014-05-09 14:18:12 +0200 | [diff] [blame] | 1356 | [[capability_viewPlugins]] |
| 1357 | === View Plugins |
| 1358 | |
| 1359 | Allow viewing the list of installed plugins. |
| 1360 | |
| 1361 | |
Fredrik Luthander | 4860300 | 2012-03-21 18:17:17 +0100 | [diff] [blame] | 1362 | [[capability_viewQueue]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1363 | === View Queue |
Fredrik Luthander | 4860300 | 2012-03-21 18:17:17 +0100 | [diff] [blame] | 1364 | |
| 1365 | Allow querying for status of Gerrit's internal task queue. This capability |
| 1366 | allows the granted group to |
| 1367 | link:cmd-show-queue.html[look at the Gerrit task queue via ssh]. |
| 1368 | |
| 1369 | |
Shawn O. Pearce | 5500e69 | 2009-05-28 15:55:01 -0700 | [diff] [blame] | 1370 | GERRIT |
| 1371 | ------ |
| 1372 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 1373 | |
| 1374 | SEARCHBOX |
| 1375 | --------- |