forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3d14e17
committed
Add a SET option to the GRANT command.
Similar to how the INHERIT option controls whether or not thepermissions of the granted role are automatically available to thegrantee, the new SET permission controls whether or not the granteemay use the SET ROLE command to assume the privileges of the grantedrole.In addition, the new SET permission controls whether or not itis possible to transfer ownership of objects to the target roleor to create new objects owned by the target role using commandssuch as CREATE DATABASE .. OWNER. We could alternatively have madethis controlled by the INHERIT option, or allow it when eitheroption is given. An advantage of this approach is that if youare granted a predefined role with INHERIT TRUE, SET FALSE, youcan't go and create objects owned by that role.The underlying theory here is that the ability to create objectsas a target role is not a privilege per se, and thus does notdepend on whether you inherit the target role's privileges. However,it's surely something you could do anyway if you could SET ROLEto the target role, and thus making it contingent on whether youhave that ability is reasonable.Design review by Nathan Bossat, Wolfgang Walther, Jeff Davis,Peter Eisentraut, and Stephen Frost.Discussion:http://postgr.es/m/CA+Tgmob+zDSRS6JXYrgq0NWdzCXuTNzT5eK54Dn2hhgt17nm8A@mail.gmail.com1 parentf84ff0c commit3d14e17
File tree
23 files changed
+315
-91
lines changed- doc/src/sgml
- ref
- src
- backend
- commands
- utils/adt
- bin/pg_dump
- include
- catalog
- utils
- test/regress
- expected
- sql
23 files changed
+315
-91
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1727 | 1727 |
| |
1728 | 1728 |
| |
1729 | 1729 |
| |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
1730 | 1741 |
| |
1731 | 1742 |
| |
1732 | 1743 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23033 | 23033 |
| |
23034 | 23034 |
| |
23035 | 23035 |
| |
23036 |
| - | |
| 23036 | + | |
| 23037 | + | |
23037 | 23038 |
| |
23038 |
| - | |
| 23039 | + | |
23039 | 23040 |
| |
23040 |
| - | |
| 23041 | + | |
| 23042 | + | |
| 23043 | + | |
23041 | 23044 |
| |
23042 | 23045 |
| |
23043 | 23046 |
| |
|
Lines changed: 22 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
| 101 | + | |
102 | 102 |
| |
103 | 103 |
| |
104 | 104 |
| |
| |||
250 | 250 |
| |
251 | 251 |
| |
252 | 252 |
| |
253 |
| - | |
254 |
| - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
255 | 257 |
| |
256 | 258 |
| |
257 | 259 |
| |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 |
| - | |
263 |
| - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
| |||
272 | 272 |
| |
273 | 273 |
| |
274 | 274 |
| |
275 |
| - | |
| 275 | + | |
| 276 | + | |
276 | 277 |
| |
277 | 278 |
| |
278 | 279 |
| |
| |||
287 | 288 |
| |
288 | 289 |
| |
289 | 290 |
| |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
290 | 302 |
| |
291 | 303 |
| |
292 | 304 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
128 |
| - | |
| 128 | + | |
129 | 129 |
| |
130 | 130 |
| |
131 | 131 |
| |
| |||
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
212 |
| - | |
213 |
| - | |
214 |
| - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
215 | 215 |
| |
216 | 216 |
| |
217 | 217 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
80 |
| - | |
| 80 | + | |
| 81 | + | |
81 | 82 |
| |
82 | 83 |
| |
83 |
| - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 |
| |
85 | 88 |
| |
86 | 89 |
| |
87 |
| - | |
| 90 | + | |
88 | 91 |
| |
89 | 92 |
| |
90 | 93 |
| |
|
Lines changed: 15 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
354 | 354 |
| |
355 | 355 |
| |
356 | 356 |
| |
357 |
| - | |
| 357 | + | |
| 358 | + | |
358 | 359 |
| |
359 | 360 |
| |
360 | 361 |
| |
| |||
369 | 370 |
| |
370 | 371 |
| |
371 | 372 |
| |
| 373 | + | |
372 | 374 |
| |
373 | 375 |
| |
| 376 | + | |
374 | 377 |
| |
375 | 378 |
| |
376 | 379 |
| |
377 |
| - | |
378 |
| - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
379 | 383 |
| |
380 | 384 |
| |
381 | 385 |
| |
| |||
384 | 388 |
| |
385 | 389 |
| |
386 | 390 |
| |
387 |
| - | |
| 391 | + | |
| 392 | + | |
388 | 393 |
| |
389 | 394 |
| |
390 | 395 |
| |
| |||
402 | 407 |
| |
403 | 408 |
| |
404 | 409 |
| |
405 |
| - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
406 | 413 |
| |
407 | 414 |
| |
| 415 | + | |
| 416 | + | |
| 417 | + | |
408 | 418 |
| |
409 | 419 |
| |
410 | 420 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
999 | 999 |
| |
1000 | 1000 |
| |
1001 | 1001 |
| |
1002 |
| - | |
| 1002 | + | |
1003 | 1003 |
| |
1004 | 1004 |
| |
1005 | 1005 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
941 | 941 |
| |
942 | 942 |
| |
943 | 943 |
| |
944 |
| - | |
| 944 | + | |
945 | 945 |
| |
946 | 946 |
| |
947 | 947 |
| |
| |||
2495 | 2495 |
| |
2496 | 2496 |
| |
2497 | 2497 |
| |
2498 |
| - | |
| 2498 | + | |
2499 | 2499 |
| |
2500 | 2500 |
| |
2501 | 2501 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
363 | 363 |
| |
364 | 364 |
| |
365 | 365 |
| |
366 |
| - | |
| 366 | + | |
367 | 367 |
| |
368 | 368 |
| |
369 | 369 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1911 | 1911 |
| |
1912 | 1912 |
| |
1913 | 1913 |
| |
1914 |
| - | |
| 1914 | + | |
1915 | 1915 |
| |
1916 | 1916 |
| |
1917 | 1917 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
97 | 97 |
| |
98 | 98 |
| |
99 | 99 |
| |
100 |
| - | |
| 100 | + | |
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
| |||
370 | 370 |
| |
371 | 371 |
| |
372 | 372 |
| |
373 |
| - | |
| 373 | + | |
374 | 374 |
| |
375 | 375 |
| |
376 | 376 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13833 | 13833 |
| |
13834 | 13834 |
| |
13835 | 13835 |
| |
13836 |
| - | |
| 13836 | + | |
13837 | 13837 |
| |
13838 | 13838 |
| |
13839 | 13839 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3745 | 3745 |
| |
3746 | 3746 |
| |
3747 | 3747 |
| |
3748 |
| - | |
| 3748 | + | |
3749 | 3749 |
| |
3750 | 3750 |
| |
3751 | 3751 |
| |
|
Lines changed: 41 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
54 |
| - | |
55 |
| - | |
| 54 | + | |
| 55 | + | |
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| 65 | + | |
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
| |||
73 | 74 |
| |
74 | 75 |
| |
75 | 76 |
| |
| 77 | + | |
76 | 78 |
| |
77 | 79 |
| |
78 | 80 |
| |
79 | 81 |
| |
| 82 | + | |
80 | 83 |
| |
81 | 84 |
| |
82 | 85 |
| |
| |||
1389 | 1392 |
| |
1390 | 1393 |
| |
1391 | 1394 |
| |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1392 | 1401 |
| |
1393 | 1402 |
| |
1394 | 1403 |
| |
| |||
1776 | 1785 |
| |
1777 | 1786 |
| |
1778 | 1787 |
| |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
1779 | 1798 |
| |
1780 | 1799 |
| |
1781 | 1800 |
| |
| |||
1798 | 1817 |
| |
1799 | 1818 |
| |
1800 | 1819 |
| |
1801 |
| - | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
1802 | 1825 |
| |
1803 | 1826 |
| |
| 1827 | + | |
| 1828 | + | |
1804 | 1829 |
| |
1805 | 1830 |
| |
1806 | 1831 |
| |
| |||
1989 | 2014 |
| |
1990 | 2015 |
| |
1991 | 2016 |
| |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
1992 | 2024 |
| |
1993 | 2025 |
| |
1994 | 2026 |
| |
| |||
2182 | 2214 |
| |
2183 | 2215 |
| |
2184 | 2216 |
| |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2185 | 2222 |
| |
2186 | 2223 |
| |
2187 | 2224 |
| |
| |||
2331 | 2368 |
| |
2332 | 2369 |
| |
2333 | 2370 |
| |
| 2371 | + | |
2334 | 2372 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
939 | 939 |
| |
940 | 940 |
| |
941 | 941 |
| |
942 |
| - | |
| 942 | + | |
943 | 943 |
| |
944 | 944 |
| |
945 | 945 |
| |
|
0 commit comments
Comments
(0)