Security label providers are an optional parameter. Fixes #1478.

This commit is contained in:
Murtuza Zabuawala
2016-07-27 15:01:16 +01:00
committed by Dave Page
parent f4f8273994
commit b6e8d195dc
5 changed files with 5 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
{% macro APPLY(conn, type, schema_name, parent_object, child_object, provider, label) -%}
SECURITY LABEL FOR {{ conn|qtIdent(provider) }} ON {{ type }} {{ conn|qtIdent(schema_name, parent_object, child_object) }} IS {{ label|qtLiteral }};
SECURITY LABEL{% if provider and provider != '' %} FOR {{ conn|qtIdent(provider) }}{% endif %} ON {{ type }} {{ conn|qtIdent(schema_name, parent_object, child_object) }} IS {{ label|qtLiteral }};
{%- endmacro %}
{% macro DROP(conn, type, schema_name, parent_object, child_object, provider) -%}
SECURITY LABEL FOR {{ conn|qtIdent(provider) }} ON {{ type }} {{ conn|qtIdent(schema_name, parent_object, child_object) }} IS NULL;
SECURITY LABEL{% if provider and provider != '' %} FOR {{ conn|qtIdent(provider) }}{% endif %} ON {{ type }} {{ conn|qtIdent(schema_name, parent_object, child_object) }} IS NULL;
{%- endmacro %}

View File

@@ -2,7 +2,7 @@
{# Macros for Security Labels (functions module) #}
{#################################################}
{% macro SET(conn, type, name, provider, label, schema, func_args) -%}
SECURITY LABEL FOR {{ provider }} ON {{ type }} {{ conn|qtIdent(schema, name) }}({{func_args}}) IS {{ label|qtLiteral }};
SECURITY LABEL{% if provider and provider != '' %} FOR {{ conn|qtIdent(provider) }}{% endif %} ON {{ type }} {{ conn|qtIdent(schema, name) }}({{func_args}}) IS {{ label|qtLiteral }};
{%- endmacro %}
{% macro UNSET(conn, type, name, provider, schema, func_args) -%}
SECURITY LABEL FOR {{ provider }} ON {{ type }} {{ conn|qtIdent(schema, name) }}({{func_args}}) IS NULL;

View File

@@ -2,7 +2,7 @@
{# Macros for schema and its child nodes #}
{##########################################}
{% macro SET(conn, type, name, provider, label, schema) -%}
SECURITY LABEL FOR {{ provider }} ON {{ type }} {{ conn|qtIdent(schema, name) }} IS {{ label|qtLiteral }};
SECURITY LABEL FOR{% if provider and provider != '' %} FOR {{ conn|qtIdent(provider) }}{% endif %} ON {{ type }} {{ conn|qtIdent(schema, name) }} IS {{ label|qtLiteral }};
{%- endmacro %}
{% macro UNSET(conn, type, name, provider, schema) -%}
SECURITY LABEL FOR {{ provider }} ON {{ type }} {{ conn|qtIdent(schema, name) }} IS NULL;