| 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 | |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 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 |
| 26 | of any other access controls. In most installations only those |
| 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 | 0907ba0 | 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 | 5d976a0 | 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 | 0907ba0 | 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 | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 76 | <<category_owner,project owners>>. Child projects inherit these |
| Fredrik Luthander | 0907ba0 | 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 | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 79 | <<category_owner,project owners>> assigned on a parent project may |
| Fredrik Luthander | 0907ba0 | 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 | 2b3cd55 | 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 | |
| 96 | It is typical to assign `Code Review -1..+1` to this group, |
| 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 | 5d976a0 | 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 | 0907ba0 | 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 | |
| 137 | |
| 138 | Project Access Control Lists |
| 139 | ---------------------------- |
| 140 | |
| lincoln | fa7bdd3 | 2010-04-22 14:23:05 -0300 | [diff] [blame] | 141 | 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] | 142 | project "`All-Projects`". This inheritance can be configured |
| lincoln | fa7bdd3 | 2010-04-22 14:23:05 -0300 | [diff] [blame] | 143 | through link:cmd-set-project-parent.html[gerrit set-project-parent]. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 144 | |
| 145 | Per-project access control lists are also supported. |
| 146 | |
| 147 | Users are permitted to use the maximum range granted to any of their |
| 148 | groups in an approval category. For example, a user is a member of |
| 149 | `Foo Leads`, and the following ACLs are granted on a project: |
| 150 | |
| Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 151 | [options="header"] |
| 152 | |================================================= |
| 153 | |Group |Reference Name |Category|Range |
| 154 | |Anonymous Users |refs/heads/*|Code Review|-1..+1 |
| 155 | |Registered Users|refs/heads/*|Code Review|-1..+2 |
| 156 | |Foo Leads |refs/heads/*|Code Review|-2..0 |
| 157 | |================================================= |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 158 | |
| 159 | Then the effective range permitted to be used by the user is |
| 160 | `-2..+2`, as the user is a member of all three groups (see above |
| 161 | about the system groups) and the maximum range is chosen (so the |
| 162 | lowest value granted to any group, and the highest value granted |
| 163 | to any group). |
| 164 | |
| Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 165 | Reference-level access control is also possible. |
| 166 | |
| 167 | Permissions can be set on a single reference name to match one |
| 168 | branch (e.g. `refs/heads/master`), or on a reference namespace |
| Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 169 | (e.g. `refs/heads/*`) to match any branch starting with that |
| 170 | prefix. So a permission with `refs/heads/*` will match |
| Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 171 | `refs/heads/master` and `refs/heads/experimental`, etc. |
| 172 | |
| Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 173 | Reference names can also be described with a regular expression |
| Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 174 | by prefixing the reference name with `^`. For example |
| 175 | `^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] | 176 | between 1 and 8 characters long. Within a regular expression `.` |
| 177 | is a wildcard matching any character, but may be escaped as `\.`. |
| Magnus Bäck | e561183 | 2011-02-02 08:57:15 +0100 | [diff] [blame] | 178 | The link:http://www.brics.dk/automaton/[dk.brics.automaton library] |
| 179 | is used for evaluation of regular expression access control |
| 180 | rules. See the library documentation for details on this |
| 181 | particular regular expression flavor. |
| Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 182 | |
| 183 | References can have the current user name automatically included, |
| 184 | creating dynamic access controls that change to match the currently |
| 185 | logged in user. For example to provide a personal sandbox space |
| Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 186 | to all developers, `refs/heads/sandbox/${username}/*` allowing |
| Shawn O. Pearce | 6d6d451 | 2010-07-15 11:42:34 -0700 | [diff] [blame] | 187 | the user 'joe' to use 'refs/heads/sandbox/joe/foo'. |
| 188 | |
| Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 189 | When evaluating a reference-level access right, Gerrit will use |
| Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 190 | the full set of access rights to determine if the user |
| 191 | is allowed to perform a given action. For example, if a user is a |
| 192 | member of `Foo Leads`, they are reviewing a change destined for |
| 193 | the `refs/heads/qa` branch, and the following ACLs are granted |
| 194 | on the project: |
| Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 195 | |
| Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 196 | [options="header"] |
| Fredrik Luthander | 2b3cd55 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 197 | |=============================================================== |
| 198 | |Group |Reference Name|Category |Range |Exclusive |
| 199 | |Registered Users |refs/heads/* |Code Review| -1..+1 | |
| 200 | |Foo Leads |refs/heads/* |Code Review| -2..+2 | |
| 201 | |QA Leads |refs/heads/qa |Code Review| -2..+2 | |
| 202 | |=============================================================== |
| Nico Sallembien | ee6eaf0 | 2010-02-01 13:24:49 -0800 | [diff] [blame] | 203 | |
| Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 204 | Then the effective range permitted to be used by the user is |
| 205 | `-2..+2`, as the user's membership of `Foo Leads` effectively grant |
| 206 | them access to the entire reference space, thanks to the wildcard. |
| 207 | |
| 208 | Gerrit also supports exclusive reference-level access control. |
| 209 | |
| 210 | It is possible to configure Gerrit to grant an exclusive ref level |
| 211 | access control so that only users of a specific group can perform |
| Fredrik Luthander | 2b3cd55 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 212 | an operation on a project/reference pair. This is done by ticking |
| 213 | the exclusive flag when setting the permission for the |
| 214 | `refs/heads/qa` branch. |
| Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 215 | |
| 216 | For example, if a user who is a member of `Foo Leads` tries to |
| 217 | review a change destined for branch `refs/heads/qa` in a project, |
| 218 | and the following ACLs are granted: |
| 219 | |
| Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 220 | [options="header"] |
| Fredrik Luthander | 2b3cd55 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 221 | |============================================================== |
| 222 | |Group |Reference Name|Category |Range |Exclusive |
| 223 | |Registered Users|refs/heads/* |Code Review| -1..+1 | |
| 224 | |Foo Leads |refs/heads/* |Code Review| -2..+2 | |
| 225 | |QA Leads |refs/heads/qa |Code Review| -2..+2 |X |
| 226 | |============================================================== |
| Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 227 | |
| 228 | Then this user will not have `Code Review` rights on that change, |
| 229 | since there is an exclusive access right in place for the |
| 230 | `refs/heads/qa` branch. This allows locking down access for a |
| 231 | particular branch to a limited set of users, bypassing inherited |
| 232 | rights and wildcards. |
| 233 | |
| 234 | In order to grant the ability to `Code Review` to the members of |
| 235 | `Foo Leads`, in `refs/heads/qa` then the following access rights |
| 236 | would be needed: |
| 237 | |
| Karsten Dambekalns | a7f72a2 | 2011-03-25 14:21:59 +0100 | [diff] [blame] | 238 | [options="header"] |
| Fredrik Luthander | 2b3cd55 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 239 | |============================================================== |
| 240 | |Group |Reference Name|Category |Range |Exclusive |
| 241 | |Registered Users|refs/heads/* |Code Review| -1..+1 | |
| 242 | |Foo Leads |refs/heads/* |Code Review| -2..+2 | |
| 243 | |QA Leads |refs/heads/qa |Code Review| -2..+2 |X |
| 244 | |Foo Leads |refs/heads/qa |Code Review| -2..+2 | |
| 245 | |============================================================== |
| Nico Sallembien | a78a37c | 2010-05-04 11:49:12 -0700 | [diff] [blame] | 246 | |
| Shawn O. Pearce | a229966 | 2009-02-25 14:34:40 -0800 | [diff] [blame] | 247 | OpenID Authentication |
| 248 | ~~~~~~~~~~~~~~~~~~~~~ |
| 249 | |
| 250 | If the Gerrit instance is configured to use OpenID authentication, |
| 251 | an account's effective group membership will be restricted to only |
| 252 | the `Anonymous Users` and `Registered Users` groups, unless *all* |
| 253 | 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] | 254 | in the `auth.trustedOpenID` list from `gerrit.config`. |
| Shawn O. Pearce | a229966 | 2009-02-25 14:34:40 -0800 | [diff] [blame] | 255 | |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 256 | All Projects |
| 257 | ~~~~~~~~~~~~ |
| 258 | |
| Shawn O. Pearce | a063182 | 2011-06-14 11:18:18 -0700 | [diff] [blame] | 259 | Any access right granted to a group within `All-Projects` |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 260 | is automatically inherited by every other project in the same |
| 261 | Gerrit instance. These rights can be seen, but not modified, |
| 262 | in any other project's `Access` administration tab. |
| 263 | |
| Fredrik Luthander | c48f9e1 | 2011-11-08 01:42:19 +0100 | [diff] [blame] | 264 | Only members of the groups with the `Administrate Server` capability |
| 265 | may edit the access control list for `All-Projects`. By default this |
| 266 | capability is given to the group `Administrators`, but can be given |
| 267 | to more groups. |
| Shawn O. Pearce | e2c2a22 | 2010-05-11 13:43:45 -0700 | [diff] [blame] | 268 | |
| 269 | Ownership of this project cannot be delegated to another group. |
| 270 | This restriction is by design. Granting ownership to another |
| 271 | group gives nearly the same level of access as membership in |
| 272 | `Administrators` does, as group members would be able to alter |
| Fredrik Luthander | c48f9e1 | 2011-11-08 01:42:19 +0100 | [diff] [blame] | 273 | permissions for every managed project including global capabilities. |
| Shawn O. Pearce | e2c2a22 | 2010-05-11 13:43:45 -0700 | [diff] [blame] | 274 | |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 275 | Per-Project |
| 276 | ~~~~~~~~~~~ |
| 277 | |
| Fredrik Luthander | 92222d4 | 2011-12-21 18:28:40 +0100 | [diff] [blame] | 278 | The per-project ACL is evaluated before the global `All-Projects` ACL, |
| 279 | permitting some limited override capability to project owners. This |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 280 | behavior is generally only useful on the `Read` category when |
| 281 | granting 'DENY' within a specific project to deny a group access. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 282 | |
| 283 | |
| Fredrik Luthander | 10cd22a | 2011-11-10 00:15:09 +0100 | [diff] [blame] | 284 | [[access_category]] |
| 285 | Access Categories |
| 286 | ----------------- |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 287 | |
| 288 | Gerrit comes pre-configured with several default categories that |
| 289 | can be granted to groups within projects, enabling functionality |
| 290 | for that group's members. |
| 291 | |
| Fredrik Luthander | b1785b8 | 2011-12-21 18:38:45 +0100 | [diff] [blame] | 292 | With the release of the Gerrit 2.2.x series, the web GUI for ACL |
| 293 | configuration was rewritten from scratch. Use this |
| 294 | <<conversion_table,table>> to better understand the access rights |
| 295 | conversions from the Gerrit 2.1.x to the Gerrit 2.2.x series. |
| 296 | |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 297 | |
| Fredrik Luthander | 10cd22a | 2011-11-10 00:15:09 +0100 | [diff] [blame] | 298 | [[category_label-Verified]] |
| 299 | Label: Verified |
| 300 | ~~~~~~~~~~~~~~~ |
| 301 | |
| 302 | The verified category is one of two default categories that is |
| 303 | configured upon the creation of a Gerrit instance. It may have |
| 304 | any meaning the project desires. It was originally invented by |
| 305 | the Android Open Source Project to mean |
| 306 | 'compiles, passes basic unit tests'. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 307 | |
| 308 | The range of values is: |
| 309 | |
| 310 | * -1 Fails |
| 311 | + |
| 312 | Tried to compile, but got a compile error, or tried to run tests, |
| Fredrik Luthander | 10cd22a | 2011-11-10 00:15:09 +0100 | [diff] [blame] | 313 | but one or more tests did not pass. This value is valid |
| 314 | across all patch sets in the same change, i.e. the reviewer must |
| 315 | actively change his/her review to something else before the change |
| 316 | is submittable. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 317 | + |
| 318 | *Any -1 blocks submit.* |
| 319 | |
| 320 | * 0 No score |
| 321 | + |
| 322 | Didn't try to perform the verification tasks. |
| 323 | |
| 324 | * +1 Verified |
| 325 | + |
| 326 | Compiled (and ran tests) successfully. |
| 327 | + |
| 328 | *Any +1 enables submit.* |
| 329 | |
| Fredrik Luthander | 10cd22a | 2011-11-10 00:15:09 +0100 | [diff] [blame] | 330 | For a change to be submittable, the change must have a `+1 Verified` |
| 331 | in this category from at least one authorized user, and no `-1 Fails` |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 332 | from an authorized user. Thus, `-1 Fails` can block a submit, |
| 333 | while `+1 Verified` enables a submit. |
| 334 | |
| 335 | If a Gerrit installation does not wish to use this category in any |
| 336 | project, it can be deleted from the database: |
| 337 | |
| 338 | ==== |
| 339 | DELETE FROM approval_categories WHERE category_id = 'VRIF'; |
| 340 | DELETE FROM approval_category_values WHERE category_id = 'VRIF'; |
| 341 | ==== |
| 342 | |
| 343 | If a Gerrit installation wants to modify the description text |
| 344 | associated with these category values, the text can be updated |
| Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 345 | in the `name` column of the `category_id = 'VRIF'` rows in the |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 346 | `approval_category_values` table. |
| 347 | |
| 348 | Additional values could also be added to this category, to allow it |
| 349 | to behave more like `Code Review` (below). Insert -2 and +2 value |
| 350 | rows into the `approval_category_values` with `category_id` set to |
| 351 | `VRIF` to get the same behavior. |
| 352 | |
| 353 | [NOTE] |
| 354 | A restart is required after making database changes. |
| 355 | See <<restart_changes,below>>. |
| 356 | |
| Fredrik Luthander | a3f73aa | 2011-12-08 16:56:03 +0100 | [diff] [blame] | 357 | [[category_label-Code-Review]] |
| 358 | Label: Code Review |
| 359 | ~~~~~~~~~~~~~~~~~~ |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 360 | |
| Fredrik Luthander | a3f73aa | 2011-12-08 16:56:03 +0100 | [diff] [blame] | 361 | The code review category is the second of two default categories that |
| 362 | is configured upon the creation of a Gerrit instance. It may have |
| 363 | any meaning the project desires. It was originally invented by the |
| 364 | Android Open Source Project to mean 'I read the code and it seems |
| 365 | reasonably correct'. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 366 | |
| 367 | The range of values is: |
| 368 | |
| 369 | * -2 Do not submit |
| 370 | + |
| 371 | The code is so horribly incorrect/buggy/broken that it must not be |
| Fredrik Luthander | a3f73aa | 2011-12-08 16:56:03 +0100 | [diff] [blame] | 372 | submitted to this project, or to this branch. This value is valid |
| 373 | across all patch sets in the same change, i.e. the reviewer must |
| 374 | actively change his/her review to something else before the change |
| 375 | is submittable. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 376 | + |
| 377 | *Any -2 blocks submit.* |
| 378 | |
| 379 | * -1 I would prefer that you didn't submit this |
| 380 | + |
| 381 | The code doesn't look right, or could be done differently, but |
| 382 | the reviewer is willing to live with it as-is if another reviewer |
| 383 | accepts it, perhaps because it is better than what is currently in |
| 384 | the project. Often this is also used by contributors who don't like |
| 385 | the change, but also aren't responsible for the project long-term |
| 386 | and thus don't have final say on change submission. |
| 387 | + |
| 388 | Does not block submit. |
| 389 | |
| 390 | * 0 No score |
| 391 | + |
| 392 | Didn't try to perform the code review task, or glanced over it but |
| 393 | don't have an informed opinion yet. |
| 394 | |
| 395 | * +1 Looks good to me, but someone else must approve |
| 396 | + |
| 397 | The code looks right to this reviewer, but the reviewer doesn't |
| 398 | have access to the `+2` value for this category. Often this is |
| 399 | used by contributors to a project who were able to review the change |
| 400 | and like what it is doing, but don't have final approval over what |
| 401 | gets submitted. |
| 402 | |
| 403 | * +2 Looks good to me, approved |
| 404 | + |
| 405 | Basically the same as `+1`, but for those who have final say over |
| 406 | how the project will develop. |
| 407 | + |
| 408 | *Any +2 enables submit.* |
| 409 | |
| Fredrik Luthander | a3f73aa | 2011-12-08 16:56:03 +0100 | [diff] [blame] | 410 | For a change to be submittable, the latest patch set must have a |
| 411 | `+2 Looks good to me, approved` in this category from at least one |
| 412 | authorized user, and no `-2 Do not submit` from an authorized user. |
| 413 | Thus `-2` on any patch set can block a submit, while `+2` on the |
| 414 | latest patch set can enable it. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 415 | |
| 416 | If a Gerrit installation does not wish to use this category in any |
| 417 | project, it can be deleted from the database: |
| 418 | |
| 419 | ==== |
| 420 | DELETE FROM approval_categories WHERE category_id = 'CRVW'; |
| 421 | DELETE FROM approval_category_values WHERE category_id = 'CRVW'; |
| 422 | ==== |
| 423 | |
| 424 | If a Gerrit installation wants to modify the description text |
| 425 | associated with these category values, the text can be updated |
| Edwin Kempin | cdb0e00 | 2011-09-08 14:23:30 +0200 | [diff] [blame] | 426 | in the `name` column of the `category_id = 'CRVW'` rows in the |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 427 | `approval_category_values` table. |
| 428 | |
| 429 | Additional values could be inserted into `approval_category_values` |
| 430 | to further extend the negative and positive range, but there is |
| 431 | likely little value in doing so as this only expands the middle |
| 432 | region. This category is a `MaxWithBlock` type, which means that |
| 433 | the lowest negative value if present blocks a submit, while the |
| 434 | highest positive value is required to enable submit. |
| 435 | |
| Shawn O. Pearce | 2d52449 | 2010-02-22 07:28:14 -0800 | [diff] [blame] | 436 | [[function_MaxNoBlock]] |
| Shane Mc Cormack | 66376d0 | 2010-01-29 19:12:58 +0000 | [diff] [blame] | 437 | There is also a `MaxNoBlock` category which still requires the |
| 438 | highest positive value to submit, but the lowest negative value will |
| 439 | not block the change, and does not carry over between patch sets. |
| 440 | This level is mostly useful for automated code-reviews that may |
| 441 | have false-negatives that shouldn't block the change. |
| 442 | |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 443 | [NOTE] |
| 444 | A restart is required after making database changes. |
| 445 | See <<restart_changes,below>>. |
| 446 | |
| Fredrik Luthander | 5aa7b59 | 2011-12-08 16:45:32 +0100 | [diff] [blame] | 447 | [[category_create]] |
| 448 | Create reference |
| 449 | ~~~~~~~~~~~~~~~~ |
| 450 | |
| 451 | The create reference category controls whether it is possible to |
| 452 | create new references, branches or tags. This implies that the |
| 453 | reference must not already exist, it's not a destructive permission |
| 454 | in that you can't overwrite or remove any previosuly existing |
| 455 | references (and also discard any commits in the process). |
| 456 | |
| 457 | It's probably most common to either permit the creation of a single |
| 458 | branch in many gits (by granting permission on a parent project), or |
| 459 | to grant this permission to a name pattern of branches. |
| 460 | |
| 461 | This permission is often given in conjunction with regular push |
| 462 | branch permissions, allowing the holder of both to create new branches |
| 463 | as well as bypass review for new commits on that branch. |
| 464 | |
| 465 | To push lightweight (non annotated) tags, grant |
| 466 | `Create Reference` for reference name `refs/tags/*`, as lightweight |
| 467 | tags are implemented just like branches in Git. |
| 468 | |
| 469 | For example, to grant the possibility to create new branches under the |
| 470 | namespace `foo`, you have to grant this permission on |
| 471 | `refs/heads/foo/*` for the group that should have it. |
| 472 | Finally, if you plan to grant each user a personal namespace in |
| 473 | where they are free to create as many branches as they wish, you |
| 474 | should grant the create reference permission so it's possible |
| 475 | to create new branches. This is done by using the special |
| 476 | `${username}` keyword in the reference pattern, e.g. |
| 477 | `refs/heads/sandbox/${username}/*`. If you do, it's also recommended |
| 478 | you grant the users the push force permission to be able to clean up |
| 479 | stale branches. |
| 480 | |
| 481 | |
| Fredrik Luthander | b295eea | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 482 | [[category_forge_author]] |
| 483 | Forge Author |
| 484 | ~~~~~~~~~~~~ |
| Fredrik Luthander | fa2e368 | 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 | b295eea | 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 | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 491 | |
| Fredrik Luthander | fa2e368 | 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 | b295eea | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 497 | |
| Fredrik Luthander | fa2e368 | 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 | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 502 | |
| Fredrik Luthander | b295eea | 2011-12-27 13:40:43 +0100 | [diff] [blame] | 503 | [[category_forge_committer]] |
| 504 | Forge Committer |
| 505 | ~~~~~~~~~~~~~~~ |
| 506 | |
| 507 | Normally Gerrit requires the author and the committer identity |
| 508 | lines in a Git commit object (or tagger line in an annotated tag) to |
| 509 | match one of the registered email addresses of the uploading user. |
| 510 | This permission allows users to bypass parts of that validation, which |
| 511 | may be necessary when mirroring changes from an upstream project. |
| 512 | |
| 513 | Allows the use of an unverified committer line in commit objects, or an |
| 514 | unverified tagger line in annotated tag objects. Typically this is only |
| 515 | required when mirroring commits from an upstream project repository. |
| 516 | |
| 517 | |
| 518 | [[category_forge_server]] |
| 519 | Forge Server |
| 520 | ~~~~~~~~~~~~ |
| 521 | |
| 522 | Normally Gerrit requires the author and the committer identity |
| 523 | lines in a Git commit object (or tagger line in an annotated tag) to |
| 524 | match one of the registered email addresses of the uploading user. |
| 525 | This permission allows users to bypass parts of that validation, which |
| 526 | may be necessary when mirroring changes from an upstream project. |
| 527 | |
| 528 | Allows the use of the server's own name and email on the committer |
| 529 | line of a new commit object. This should only be necessary when force |
| 530 | pushing a commit history which has been rewritten by 'git filter-branch' |
| 531 | and that contains merge commits previously created by this Gerrit Code |
| 532 | Review server. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 533 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 534 | |
| 535 | [[category_owner]] |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 536 | Owner |
| 537 | ~~~~~ |
| 538 | |
| 539 | The `Owner` category controls which groups can modify the project's |
| 540 | configuration. Users who are members of an owner group can: |
| 541 | |
| 542 | * Change the project description |
| 543 | * Create/delete a branch through the web UI (not SSH) |
| 544 | * Grant/revoke any access rights, including `Owner` |
| 545 | |
| 546 | Note that project owners implicitly have branch creation or deletion |
| 547 | through the web UI, but not through SSH. To get SSH branch access |
| 548 | project owners must grant an access right to a group they are a |
| 549 | member of, just like for any other user. |
| 550 | |
| 551 | Ownership over a particular branch subspace may be delegated by |
| 552 | entering a branch pattern. To delegate control over all branches |
| 553 | that begin with `qa/` to the QA group, add `Owner` category |
| Edwin Kempin | 9ad2761 | 2011-11-21 10:59:25 +0100 | [diff] [blame] | 554 | for reference `refs/heads/qa/*`. Members of the QA group can |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 555 | further refine access, but only for references that begin with |
| Fredrik Luthander | 0907ba0 | 2011-11-07 17:04:01 +0100 | [diff] [blame] | 556 | `refs/heads/qa/`. See <<project_owners,project owners>> to find |
| 557 | out more about this role. |
| 558 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 559 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 560 | [[category_push]] |
| 561 | Push |
| 562 | ~~~~ |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 563 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 564 | This category controls how users are allowed to upload new commits |
| 565 | to projects in Gerrit. It can either give permission to push |
| 566 | directly into a branch, bypassing any code review process |
| 567 | that would otherwise be used. Or it may give permission to upload |
| 568 | new changes for code review, this depends on which namespace the |
| 569 | permission is granted to. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 570 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 571 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 572 | [[category_push_direct]] |
| 573 | Direct Push |
| 574 | ^^^^^^^^^^^ |
| 575 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 576 | Any existing branch can be fast-forwarded to a new commit. |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 577 | Creation of new branches is controlled by the |
| 578 | link:access-control.html#category_create['Create Reference'] |
| 579 | category. Deletion of existing branches is rejected. This is the |
| 580 | safest mode as commits cannot be discarded. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 581 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 582 | * Force option |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 583 | + |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 584 | Allows an existing branch to be deleted. Since a force push is |
| 585 | effectively a delete immediately followed by a create, but performed |
| 586 | atomically on the server and logged, this option also permits forced |
| 587 | push updates to branches. Enabling this option allows existing commits |
| 588 | to be discarded from a project history. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 589 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 590 | The push category is primarily useful for projects that only want to |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 591 | take advantage of Gerrit's access control features and do not need |
| 592 | its code review functionality. Projects that need to require code |
| 593 | reviews should not grant this category. |
| 594 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 595 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 596 | [[category_push_review]] |
| 597 | Upload To Code Review |
| 598 | ^^^^^^^^^^^^^^^^^^^^^ |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 599 | |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 600 | The `Push` access right granted on the namespace |
| 601 | `refs/for/refs/heads/BRANCH` permits the user to upload a non-merge |
| 602 | commit to the project's `refs/for/BRANCH` namespace, creating a new |
| 603 | change for code review. |
| 604 | |
| 605 | A user must be able to clone or fetch the project in order to create |
| 606 | a new commit on their local system, so in practice they must also |
| 607 | have the `Read` access granted to upload a change. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 608 | |
| 609 | For an open source, public Gerrit installation, it is common to |
| Fredrik Luthander | 0bb123d | 2011-12-29 11:36:48 +0100 | [diff] [blame] | 610 | grant `Read` and `Push` for `refs/for/refs/heads/*` |
| 611 | to `Registered Users` in the `All-Projects` ACL. For more |
| 612 | private installations, its common to simply grant `Read` and |
| 613 | `Push` for `refs/for/refs/heads/*` to all users of a project. |
| 614 | |
| 615 | * Force option |
| 616 | + |
| 617 | The force option has no function when granted to a branch in the |
| 618 | `refs/for/refs/heads/*` namespace. |
| 619 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 620 | |
| Fredrik Luthander | 5168057 | 2012-01-18 11:17:00 +0100 | [diff] [blame] | 621 | [[category_push_merge]] |
| Edwin Kempin | aef5d6e | 2012-01-24 09:04:54 +0100 | [diff] [blame^] | 622 | Push Merge Commits |
| Fredrik Luthander | 5168057 | 2012-01-18 11:17:00 +0100 | [diff] [blame] | 623 | ~~~~~~~~~~~~~~~~~~~~ |
| 624 | |
| Edwin Kempin | aef5d6e | 2012-01-24 09:04:54 +0100 | [diff] [blame^] | 625 | The `Push Merge Commit` permits the user to upload merge commits. |
| 626 | It's an addon to the <<category_push,Push>> access right, and so it |
| 627 | won't be sufficient with only `Push Merge Commit` granted for a push |
| 628 | to happen. Some projects wish to restrict merges to being created by |
| 629 | Gerrit. By granting `Push` without `Push Merge Commit`, the only |
| 630 | merges that enter the system will be those created by Gerrit. |
| Fredrik Luthander | 5168057 | 2012-01-18 11:17:00 +0100 | [diff] [blame] | 631 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 632 | |
| Fredrik Luthander | 5b75c00 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 633 | [[category_push_annotated]] |
| 634 | Push Annotated Tag |
| 635 | ~~~~~~~~~~~~~~~~~~ |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 636 | |
| 637 | This category permits users to push an annotated tag object over |
| 638 | SSH into the project's repository. Typically this would be done |
| 639 | with a command line such as: |
| 640 | |
| 641 | ==== |
| 642 | git push ssh://USER@HOST:PORT/PROJECT tag v1.0 |
| 643 | ==== |
| 644 | |
| 645 | Tags must be annotated (created with `git tag -a` or `git tag -s`), |
| 646 | should exist in the `refs/tags/` namespace, and should be new. |
| 647 | |
| 648 | This category is intended to be used to publish tags when a project |
| 649 | reaches a stable release point worth remembering in history. |
| 650 | |
| Fredrik Luthander | 5b75c00 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 651 | It allows for a new annotated (unsigned) tag to be created. The |
| 652 | tagger email address must be verified for the current user. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 653 | |
| 654 | To push tags created by users other than the current user (such |
| Fredrik Luthander | 5b75c00 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 655 | as tags mirrored from an upstream project), `Forge Committer Identity` |
| 656 | must be also granted in addition to `Push Annotated Tag`. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 657 | |
| Fredrik Luthander | 5b75c00 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 658 | To push lightweight (non annotated) tags, grant |
| 659 | <<category_create,`Create Reference`>> for reference name |
| 660 | `refs/tags/*`, as lightweight tags are implemented just like |
| 661 | branches in Git. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 662 | |
| Fredrik Luthander | 5b75c00 | 2012-01-20 07:29:43 +0100 | [diff] [blame] | 663 | To delete or overwrite an existing tag, grant `Push` with the force |
| 664 | option enabled for reference name `refs/tags/*`, as deleting a tag |
| 665 | requires the same permission as deleting a branch. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 666 | |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 667 | |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 668 | [[category_read]] |
| 669 | Read |
| 670 | ~~~~ |
| 671 | |
| 672 | The `Read` category controls visibility to the project's |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 673 | changes, comments, code diffs, and Git access over SSH or HTTP. |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 674 | A user must have this access granted in order to see a project, its |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 675 | changes, or any of its data. |
| 676 | |
| 677 | This category has a special behavior, where the per-project ACL is |
| 678 | evaluated before the global all projects ACL. If the per-project |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 679 | ACL has granted `Read` with 'DENY', and does not otherwise grant |
| 680 | `Read` with 'ALLOW', then a `Read` in the all projects ACL |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 681 | is ignored. This behavior is useful to hide a handful of projects |
| 682 | on an otherwise public server. |
| 683 | |
| 684 | For an open source, public Gerrit installation it is common to grant |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 685 | `Read` to `Anonymous Users` in the `All-Projects` ACL, enabling |
| 686 | casual browsing of any project's changes, as well as fetching any |
| 687 | project's repository over SSH or HTTP. New projects can be |
| 688 | temporarily hidden from public view by granting `Read` with 'DENY' |
| 689 | to `Anonymous Users` and granting `Read` to the project owner's |
| 690 | group within the per-project ACL. |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 691 | |
| 692 | For a private Gerrit installation using a trusted HTTP authentication |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 693 | source, granting `Read` to `Registered Users` may be more |
| Fredrik Luthander | fa2e368 | 2011-11-03 08:52:56 +0100 | [diff] [blame] | 694 | typical, enabling read access only to those users who have been |
| 695 | able to authenticate through the HTTP access controls. This may |
| 696 | be suitable in a corporate deployment if the HTTP access control |
| 697 | is already restricted to the correct set of users. |
| 698 | |
| Fredrik Luthander | 5d976a0 | 2012-01-20 13:06:06 +0100 | [diff] [blame] | 699 | |
| 700 | [[category_submit]] |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 701 | Submit |
| 702 | ~~~~~~ |
| 703 | |
| 704 | This category permits users to push the `Submit Patch Set n` button |
| 705 | on the web UI. |
| 706 | |
| 707 | Submitting a change causes it to be merged into the destination |
| 708 | branch as soon as possible, making it a permanent part of the |
| 709 | project's history. |
| 710 | |
| 711 | In order to submit, all approval categories (such as `Verified` and |
| 712 | `Code Review`, above) must enable submit, and also must not block it. |
| 713 | See above for details on each category. |
| 714 | |
| 715 | [[category_makeoneup]] |
| 716 | Your Category Here |
| 717 | ~~~~~~~~~~~~~~~~~~ |
| 718 | |
| 719 | Gerrit administrators can also make up their own categories. |
| 720 | |
| Fredrik Luthander | 2b3cd55 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 721 | See above for descriptions of how <<category_verified,`Verified`>> |
| 722 | and <<category_review,`Code Review`>> work, and insert your own |
| 723 | category with `function_name = 'MaxWithBlock'` to get the same |
| 724 | behavior over your own range of values, in any category you desire. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 725 | |
| 726 | Ensure `category_id` is unique within your `approval_categories` |
| 727 | table. The default values `VRIF` and `CVRF` used for the categories |
| 728 | described above are simply that, defaults, and have no special |
| Fredrik Luthander | 2b3cd55 | 2012-01-20 16:18:41 +0100 | [diff] [blame] | 729 | meaning to Gerrit. |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 730 | |
| 731 | The `position` column of `approval_categories` controls which column |
| 732 | of the 'Approvals' table the category appears in, providing some |
| 733 | layout control to the administrator. |
| 734 | |
| 735 | All `MaxWithBlock` categories must have at least one positive value |
| 736 | in the `approval_category_values` table, or else submit will never |
| 737 | be enabled. |
| 738 | |
| 739 | To permit blocking submits, ensure a negative value is defined for |
| 740 | your new category. If you do not wish to have a blocking submit |
| 741 | level for your category, do not define values less than 0. |
| 742 | |
| 743 | Keep in mind that category definitions are currently global to |
| 744 | the entire Gerrit instance, and affect all projects hosted on it. |
| 745 | Any change to a category definition affects everyone. |
| 746 | |
| 747 | For example, to define a new 3-valued category that behaves exactly |
| 748 | like `Verified`, but has different names/labels: |
| 749 | |
| 750 | ==== |
| 751 | INSERT INTO approval_categories |
| 752 | (name |
| 753 | ,position |
| 754 | ,function_name |
| 755 | ,category_id) |
| 756 | VALUES |
| 757 | ('Copyright Check' |
| 758 | ,3 |
| Edwin Kempin | 6cc5ee0 | 2012-01-10 13:59:46 +0100 | [diff] [blame] | 759 | ,'MaxWithBlock' |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 760 | ,'copy'); |
| 761 | |
| 762 | INSERT INTO approval_category_values |
| 763 | (category_id,value,name) |
| 764 | VALUES |
| 765 | ('copy', -1, 'Do not have copyright'); |
| 766 | |
| 767 | INSERT INTO approval_category_values |
| 768 | (category_id,value,name) |
| 769 | VALUES |
| 770 | ('copy', 0, 'No score'); |
| 771 | |
| 772 | INSERT INTO approval_category_values |
| 773 | (category_id,value,name) |
| 774 | VALUES |
| 775 | ('copy', 1, 'Copyright clear'); |
| 776 | ==== |
| 777 | |
| 778 | The new column will appear at the end of the table (in position 3), |
| 779 | and `-1 Do not have copyright` will block submit, while `+1 Copyright |
| 780 | clear` is required to enable submit. |
| 781 | |
| Fredrik Luthander | b1785b8 | 2011-12-21 18:38:45 +0100 | [diff] [blame] | 782 | |
| 783 | [[conversion_table]] |
| 784 | Conversion table from 2.1.x series to 2.2.x series |
| 785 | -------------------------------------------------- |
| 786 | |
| 787 | [options="header"] |
| 788 | |================================================================================= |
| 789 | |Gerrit 2.1.x |Gerrit 2.2.x |
| Fredrik Luthander | b7bd7e4 | 2012-01-23 16:01:37 +0100 | [diff] [blame] | 790 | |Code review |<<category_label-Code-Review,Label: Code review>> |
| 791 | |Verify |<<category_label-Verified,Label: Verify>> |
| 792 | |Forge Identity +1 |Forge <<category_forge_author,author>> identity |
| 793 | |Forge Identity +2 |Forge <<category_forge_committer,committer>> & <<category_forge_author,author>> identity |
| 794 | |Forge Identity +3 |Forge <<category_forge_server,server>> & <<category_forge_committer,committer>> & <<category_forge_author,author>> identity |
| 795 | |Owner |<<category_owner,Owner>> |
| 796 | |Push branch +1 |<<category_push_direct,Push>> |
| 797 | |Push branch +2 |<<category_create,Create reference>> & <<category_push_direct,Push>> |
| 798 | |Push branch +3 |<<category_push_direct,Push>> (with force) & <<category_create,Create reference>> |
| Fredrik Luthander | b1785b8 | 2011-12-21 18:38:45 +0100 | [diff] [blame] | 799 | |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] | 800 | |Push tag +2 & Push Branch +2 |<<category_push_annotated,Push annotated tag>> |
| 801 | |Push Branch +2 (refs/tags/*) |<<category_create,Create reference>> (refs/tags/...) |
| 802 | |Push Branch +3 (refs/tags/*) |<<category_push_direct,Push>> (with force on refs/tags/...) |
| 803 | |Read +1 |<<category_read,Read>> |
| 804 | |Read +2 |<<category_read,Read>> & <<category_push_review,Push>> (refs/for/refs/...) |
| Edwin Kempin | aef5d6e | 2012-01-24 09:04:54 +0100 | [diff] [blame^] | 805 | |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] | 806 | |Submit |<<category_submit,Submit>> |
| Fredrik Luthander | b1785b8 | 2011-12-21 18:38:45 +0100 | [diff] [blame] | 807 | |================================================================================= |
| 808 | |
| Fredrik Luthander | b7bd7e4 | 2012-01-23 16:01:37 +0100 | [diff] [blame] | 809 | |
| Fredrik Luthander | b1785b8 | 2011-12-21 18:38:45 +0100 | [diff] [blame] | 810 | [NOTE] |
| 811 | In Gerrit 2.2.x, the way to set permissions for upload has changed entirely. |
| 812 | To upload a change for review is no longer a separate permission type, |
| 813 | instead you grant ordinary push permissions to the actual |
| 814 | recieving reference. In practice this means that you set push permissions |
| 815 | on `refs/for/refs/heads/<branch>` rather than permissions to upload changes |
| 816 | on `refs/heads/<branch>`. |
| 817 | |
| Shawn O. Pearce | 4b122b8 | 2009-02-18 18:22:14 -0800 | [diff] [blame] | 818 | [[restart_changes]] |
| 819 | [NOTE] |
| 820 | Restart the Gerrit web application and reload all browsers after |
| Shawn O. Pearce | c40ea19 | 2009-08-21 18:56:21 -0700 | [diff] [blame] | 821 | making any database changes to approval categories. Browsers are |
| 822 | sent the list of known categories when they first visit the site, |
| 823 | and don't notice changes until the page is closed and opened again, |
| 824 | or is reloaded. |
| Shawn O. Pearce | 5500e69 | 2009-05-28 15:55:01 -0700 | [diff] [blame] | 825 | |
| 826 | GERRIT |
| 827 | ------ |
| 828 | Part of link:index.html[Gerrit Code Review] |