mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added two jinja2 template macro for support for priviliges and default
privileges. Also, made a change in the privilege.js to scroll the div to make the opening div visible properly.
This commit is contained in:
committed by
Ashesh Vashi
parent
7f3c972d06
commit
d0f7e69ad7
@@ -0,0 +1,14 @@
|
||||
{% macro APPLY(conn, type, role, priv, with_grant) -%}
|
||||
{% if priv %}
|
||||
ALTER DEFAULT PRIVILEGES
|
||||
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;
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
{% macro RESETALL(conn, type, role) -%}
|
||||
ALTER DEFAULT PRIVILEGES
|
||||
REVOKE ALL ON {{ type }} FROM {{ conn|qtIdent(role) }};
|
||||
{%- endmacro %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% macro APPLY(conn, type, role, param, priv, with_grant) -%}
|
||||
{% if priv %}
|
||||
GRANT {{ priv }} ON {{ type }} {{ conn|qtIdent(param) }} TO {{ conn|qtIdent(role) }};
|
||||
{% endif %}
|
||||
{% if with_grant %}
|
||||
GRANT {{ with_grant }} 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 %}
|
||||
Reference in New Issue
Block a user