mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-26 21:27:39 -05:00
This will also allow us to operate on individual privileges & also we
needed this functionality for column nodes.
For example,
*Earlier:* priv was string
GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};
*Now:* priv will be List, which we need to handle in jinja templates.
GRANT *{{ priv|join(', ') }}* ON {{ type }} TO {{ conn|qtIdent(role) }};
11 lines
519 B
Plaintext
11 lines
519 B
Plaintext
{% macro APPLY(conn, type, role, param, privs, with_grant_privs) -%}
|
|
{% if privs %}
|
|
GRANT {{ privs|join(', ') }} ON {{ type }} {{ conn|qtIdent(param) }} TO {{ conn|qtIdent(role) }};
|
|
{% endif %}
|
|
{% if with_grant_privs %}
|
|
GRANT {{ with_grant_privs|join(', ') }} ON {{ type }} {{ conn|qtIdent(param) }} TO {{ conn|qtIdent(role) }} WITH GRANT OPTION;
|
|
{% endif %}
|
|
{%- endmacro %}
|
|
{% macro RESETALL(conn, type, role, param) -%}
|
|
REVOKE ALL ON {{ type }} {{ conn|qtIdent(param) }} FROM {{ conn|qtIdent(role) }};
|
|
{%- endmacro %} |