1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Allow makeaclitem() to accept multiple privilege names.

Interpret its privileges argument as a comma-separated list of
privilege names, as in has_table_privilege and other functions.
This is actually net less code, since the support routine to
parse that already exists, and we can drop convert_priv_string()
which had no other use-case.

Robins Tharakan

Discussion: https://postgr.es/m/e5a05dc54ba64408b3dd260171c1abaf@EX13D05UWC001.ant.amazon.com
This commit is contained in:
Tom Lane
2022-07-03 16:49:12 -04:00
parent b6a5158f98
commit b762bbde30
4 changed files with 54 additions and 47 deletions

View File

@ -24236,7 +24236,8 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
If the grantee is the pseudo-role PUBLIC, it is represented by zero in
the <parameter>grantee</parameter> column. Each granted privilege is
represented as <literal>SELECT</literal>, <literal>INSERT</literal>,
etc. Note that each privilege is broken out as a separate row, so
etc (see <xref linkend="privilege-abbrevs-table"/> for a full list).
Note that each privilege is broken out as a separate row, so
only one keyword appears in the <parameter>privilege_type</parameter>
column.
</para></entry>
@ -24256,6 +24257,12 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
</para>
<para>
Constructs an <type>aclitem</type> with the given properties.
<parameter>privileges</parameter> is a comma-separated list of
privilege names such as <literal>SELECT</literal>,
<literal>INSERT</literal>, etc, all of which are set in the
result. (Case of the privilege string is not significant, and
extra whitespace is allowed between but not within privilege
names.)
</para></entry>
</row>
</tbody>