@@ -17,12 +17,18 @@ Let's assume we have a schema `appschema`, and `appuser` should have
17
17
` SELECT ` , ` UPDATE ` , ` DELETE ` and ` INSERT ` permissions on all tables and
18
18
views in that schema:
19
19
20
- INSERT INTO public.permission_target VALUES
20
+ INSERT INTO public.permission_target
21
+ (id, role_name, permissions,
22
+ object_type, schema_name)
23
+ VALUES
21
24
(1, 'appuser', '{SELECT,INSERT,UPDATE,DELETE}',
22
- 'TABLE', 'appschema', NULL, NULL);
23
- INSERT INTO public.permission_target VALUES
25
+ 'TABLE', 'appschema');
26
+ INSERT INTO public.permission_target
27
+ (id, role_name, permissions,
28
+ object_type, schema_name)
29
+ VALUES
24
30
(2, 'appuser', '{SELECT,INSERT,UPDATE,DELETE}',
25
- 'VIEW', 'appschema', NULL, NULL );
31
+ 'VIEW', 'appschema');
26
32
27
33
The user also needs ` USAGE ` privileges on the ` appseq ` sequence in
28
34
that schema:
@@ -36,6 +42,17 @@ permissions are granted:
36
42
37
43
SELECT * FROM public.permission_diffs();
38
44
45
+ missing | role_name | object_type | schema_name | object_name | column_name | permission
46
+ ---------+-----------+-------------+-------------+-------------+-------------+------------
47
+ f | laurenz | VIEW | appschema | appview | | SELECT
48
+ t | appuser | TABLE | appschema | apptable | | DELETE
49
+ (2 rows)
50
+
51
+ That means that ` appuser ` is missing the ` DELETE ` privilege on
52
+ ` appschema.apptable ` which should be granted, while user ` laurenz `
53
+ has the additional ` SELECT ` privilege on ` appschema.appview ` (` missing `
54
+ is ` FALSE ` ).
55
+
39
56
Usage
40
57
-----
41
58
0 commit comments