diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-26 00:04:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-07-26 00:04:19 +0000 |
commit | f9fd1764615ed5d85fab703b0ffb0c323fe7dfd5 (patch) | |
tree | fce5ae4aa26bd0f1f085358f9bdcd3cb60db7058 /doc/src | |
parent | e5d6b91220d69c87f44e1ce0095516946abc6d6c (diff) | |
download | postgresql-f9fd1764615ed5d85fab703b0ffb0c323fe7dfd5.tar.gz postgresql-f9fd1764615ed5d85fab703b0ffb0c323fe7dfd5.zip |
Add pg_has_role() family of privilege inquiry functions modeled after the
existing ones for object privileges. Update the information_schema for
roles --- pg_has_role() makes this a whole lot easier, removing the need
for most of the explicit joins with pg_user. The views should be a tad
faster now, too. Stephen Frost and Tom Lane.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 37087355150..b5ce30105bc 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.270 2005/07/25 22:12:30 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.271 2005/07/26 00:04:17 tgl Exp $ PostgreSQL documentation --> @@ -8428,6 +8428,21 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, .. <entry>does current user have privilege for language</entry> </row> <row> + <entry><literal><function>pg_has_role</function>(<parameter>user</parameter>, + <parameter>role</parameter>, + <parameter>privilege</parameter>)</literal> + </entry> + <entry><type>boolean</type></entry> + <entry>does user have privilege for role</entry> + </row> + <row> + <entry><literal><function>pg_has_role</function>(<parameter>role</parameter>, + <parameter>privilege</parameter>)</literal> + </entry> + <entry><type>boolean</type></entry> + <entry>does current user have privilege for role</entry> + </row> + <row> <entry><literal><function>has_schema_privilege</function>(<parameter>user</parameter>, <parameter>schema</parameter>, <parameter>privilege</parameter>)</literal> @@ -8474,6 +8489,9 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, .. <primary>has_language_privilege</primary> </indexterm> <indexterm zone="functions-info"> + <primary>pg_has_role</primary> + </indexterm> + <indexterm zone="functions-info"> <primary>has_schema_privilege</primary> </indexterm> <indexterm zone="functions-info"> @@ -8537,6 +8555,14 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute'); </para> <para> + <function>pg_has_role</function> checks whether a user + can access a role in a particular way. The possibilities for its + arguments are analogous to <function>has_table_privilege</function>. + The desired access privilege type must evaluate to + <literal>MEMBER</literal>. + </para> + + <para> <function>has_schema_privilege</function> checks whether a user can access a schema in a particular way. The possibilities for its arguments are analogous to <function>has_table_privilege</function>. |