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