mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Make the default privileges jinja2 template macros to generate more
consistent SQL. i.e. Put 4 spaces after every new line (wherever required).
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
{% macro APPLY(conn, type, role, priv, with_grant) -%}
|
||||
{% if priv %}
|
||||
ALTER DEFAULT PRIVILEGES
|
||||
GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};
|
||||
GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};
|
||||
{% endif %}
|
||||
{% if with_grant %}
|
||||
ALTER DEFAULT PRIVILEGES
|
||||
GRANT {{ with_grant }} ON {{ type }} TO {{ conn|qtIdent(role) }} WITH GRANT OPTION;
|
||||
GRANT {{ with_grant }} ON {{ type }} TO {{ conn|qtIdent(role) }} WITH GRANT OPTION;
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
{% macro RESETALL(conn, type, role) -%}
|
||||
@@ -16,14 +16,14 @@ ALTER DEFAULT PRIVILEGES
|
||||
{% macro SET(conn, db_object_type, db_object_name, type, role, priv, with_grant) -%}
|
||||
{% if priv %}
|
||||
ALTER DEFAULT PRIVILEGES IN {{ db_object_type }} {{ conn|qtIdent(db_object_name) }}
|
||||
GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};
|
||||
GRANT {{ priv }} ON {{ type }} TO {{ conn|qtIdent(role) }};
|
||||
{% endif %}
|
||||
{% if with_grant %}
|
||||
ALTER DEFAULT PRIVILEGES IN {{ db_object_type }} {{ conn|qtIdent(db_object_name) }}
|
||||
GRANT {{ with_grant }} ON {{ type }} TO {{ conn|qtIdent(role) }} WITH GRANT OPTION;
|
||||
GRANT {{ with_grant }} ON {{ type }} TO {{ conn|qtIdent(role) }} WITH GRANT OPTION;
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
{% macro UNSET(conn, db_object_type, db_object_name, type, role) -%}
|
||||
ALTER DEFAULT PRIVILEGES IN {{ db_object_type }} {{ conn|qtIdent(db_object_name) }}
|
||||
REVOKE ALL ON {{ type }} FROM {{ conn|qtIdent(role) }};
|
||||
{%- endmacro %}
|
||||
{%- endmacro %}
|
||||
|
||||
Reference in New Issue
Block a user