From 41e85fd63128ce495cc3bae2694b55a55adbc204 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Sun, 28 Feb 2016 12:06:21 +0530 Subject: [PATCH] Make the default privileges jinja2 template macros to generate more consistent SQL. i.e. Put 4 spaces after every new line (wherever required). --- .../servers/templates/macros/default_privilege.macros | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros b/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros index 4bfd60f2a..d612760a3 100644 --- a/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros +++ b/web/pgadmin/browser/server_groups/servers/templates/macros/default_privilege.macros @@ -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 %} \ No newline at end of file +{%- endmacro %}