mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix the issue in MATERIALIZED VIEW node where user was not able to add/update security label. Fixes #1458
This commit is contained in:
committed by
Dave Page
parent
517a797947
commit
e94b14e7d7
@@ -1,6 +1,6 @@
|
||||
{# ===== Grant Permissions to User Role on Views/Tables ==== #}
|
||||
{% import 'macros/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
|
||||
{# We will generate Security Label SQL using macro #}
|
||||
{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{% endfor %}{% endif %}
|
||||
{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}{% endfor %}{% endif %}
|
||||
{% if data.datacl %}{% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{# ===================== Update View ===================#}
|
||||
{% import 'macros/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
|
||||
{%- if data -%}
|
||||
{% set view_name = data.name if data.name else o_data.name %}
|
||||
@@ -197,17 +197,17 @@ COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||
{% set seclabels = data.seclabels %}
|
||||
{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
|
||||
{% for r in seclabels.deleted %}
|
||||
{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
|
||||
{{ SECLABLE.UNSET(conn, 'MATERIALIZED VIEW', data.name, r.provider, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if 'added' in seclabels and seclabels.added|length > 0 %}
|
||||
{% for r in seclabels.added %}
|
||||
{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
|
||||
{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
|
||||
{% for r in seclabels.changed %}
|
||||
{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
|
||||
{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{# ===== Grant Permissions to User Role on Views/Tables ==== #}
|
||||
{% import 'macros/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
|
||||
{# We will generate Security Label SQL using macro #}
|
||||
{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{% endfor %}{% endif %}
|
||||
{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}{% endfor %}{% endif %}
|
||||
{% if data.datacl %}{% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{# ===================== Update View ===================#}
|
||||
{% import 'macros/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
|
||||
{%- if data -%}
|
||||
{% set view_name = data.name if data.name else o_data.name %}
|
||||
@@ -197,17 +197,17 @@ COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||
{% set seclabels = data.seclabels %}
|
||||
{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
|
||||
{% for r in seclabels.deleted %}
|
||||
{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
|
||||
{{ SECLABLE.UNSET(conn, 'MATERIALIZED VIEW', data.name, r.provider, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if 'added' in seclabels and seclabels.added|length > 0 %}
|
||||
{% for r in seclabels.added %}
|
||||
{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
|
||||
{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
|
||||
{% for r in seclabels.changed %}
|
||||
{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
|
||||
{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{# ===== Grant Permissions to User Role on Views/Tables ==== #}
|
||||
{% import 'macros/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
|
||||
{# We will generate Security Label SQL using macro #}
|
||||
{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}{% endfor %}{% endif %}
|
||||
{% if data.seclabels %}{% for r in data.seclabels %}{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}{% endfor %}{% endif %}
|
||||
{% if data.datacl %}{% for priv in data.datacl %}{{ PRIVILEGE.SET(conn, 'TABLE', priv.grantee, data.name, priv.without_grant, priv.with_grant, data.schema) }}{% endfor %}{% endif %}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{# ===================== Update View ===================#}
|
||||
{% import 'macros/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/security.macros' as SECLABLE %}
|
||||
{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
|
||||
{%- if data -%}
|
||||
{% set view_name = data.name if data.name else o_data.name %}
|
||||
@@ -197,17 +197,17 @@ COMMENT ON MATERIALIZED VIEW {{ conn|qtIdent(view_schema, view_name) }}
|
||||
{% set seclabels = data.seclabels %}
|
||||
{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}
|
||||
{% for r in seclabels.deleted %}
|
||||
{{ SECLABLE.DROP(conn, 'VIEW', data.name, r.provider) }}
|
||||
{{ SECLABLE.UNSET(conn, 'MATERIALIZED VIEW', data.name, r.provider, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if 'added' in seclabels and seclabels.added|length > 0 %}
|
||||
{% for r in seclabels.added %}
|
||||
{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
|
||||
{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if 'changed' in seclabels and seclabels.changed|length > 0 %}
|
||||
{% for r in seclabels.changed %}
|
||||
{{ SECLABLE.APPLY(conn, 'VIEW', data.name, r.provider, r.label) }}
|
||||
{{ SECLABLE.SET(conn, 'MATERIALIZED VIEW', data.name, r.provider, r.label, data.schema) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user