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,5 +1,5 @@
{% macro APPLY(conn, type, name, provider, label) -%}
SECURITY LABEL FOR {{ conn|qtIdent(provider) }} ON {{ type }} {{ conn|qtIdent(name) }} IS {{ label|qtLiteral }};
SECURITY LABEL{% if provider and provider != '' %} FOR {{ conn|qtIdent(provider) }}{% endif %} ON {{ type }} {{ conn|qtIdent(name) }} IS {{ label|qtLiteral }};
{%- endmacro %}
{% macro DROP(conn, type, name, provider) -%}
SECURITY LABEL FOR {{ conn|qtIdent(provider) }} ON {{ type }} {{ conn|qtIdent(name) }} IS NULL;

View File

@@ -23,14 +23,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
errmsg = null;
this.errorModel.clear();
if (_.isUndefined(this.get('provider')) ||
_.isNull(this.get('provider')) ||
String(this.get('provider')).replace(/^\s+|\s+$/g, '') == '') {
errmsg = '{{ _('Provider must be specified.') }}';
this.errorModel.set('provider', errmsg);
return errmsg;
}
if (_.isUndefined(this.get('label')) ||
_.isNull(this.get('label')) ||
String(this.get('label')).replace(/^\s+|\s+$/g, '') == '') {