diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js index 91df7bd..7b6cb73 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/templates/domains/js/domains.js @@ -292,10 +292,13 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { type: 'collection', group: '{{ _('Constraints') }}', mode: ['edit', 'create'], model: ConstraintModel, canAdd: true, canDelete: true, canEdit: false, columns: ['conname','consrc', 'convalidated'] - },{ + },{ + id: 'security', label: '{{ _("Security") }}', + type: 'group', visible: pgAdmin.is_security_group_under_catalog + },{ id: 'seclabels', label: '{{ _('Security Labels') }}', model: SecurityModel, type: 'collection', - group: '{{ _('Security') }}', mode: ['edit', 'create'], + group: 'security', mode: ['edit', 'create'], min_version: 90100, canAdd: true, canEdit: false, canDelete: true, control: 'unique-col-collection', uniqueCol : ['provider'] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/js/foreign_tables.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/js/foreign_tables.js index 2e730f8..3edd1f8 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/js/foreign_tables.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/js/foreign_tables.js @@ -673,17 +673,20 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { type: 'text', group: '{{ _('Security') }}', mode: ['properties'], min_version: 90200 },{ + id: 'security', label: '{{ _("Security") }}', + type: 'group', visible: pgAdmin.is_security_group_under_catalog + },{ id: 'acl', label: '{{ _('Privileges') }}', model: pgAdmin .Browser.Node.PrivilegeRoleModel.extend( {privileges: ['a','r','w','x']}), uniqueCol : ['grantee', 'grantor'], - editable: false, type: 'collection', group: '{{ _('Security') }}', + editable: false, type: 'collection', group: 'security', mode: ['edit', 'create'], canAdd: true, canDelete: true, control: 'unique-col-collection', min_version: 90200 },{ id: 'seclabels', label: '{{ _('Security Labels') }}', model: SecurityModel, type: 'collection', - group: '{{ _('Security') }}', mode: ['edit', 'create'], + group: 'security', mode: ['edit', 'create'], min_version: 90100, canAdd: true, canEdit: false, canDelete: true, control: 'unique-col-collection', uniqueCol : ['provider'] diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js index 39a7bc5..20b06d2 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/functions/templates/function/js/functions.js @@ -323,11 +323,14 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { model: pgAdmin.Browser.Node.VariableModel, mode: ['edit', 'create'], canAdd: 'canVarAdd', canEdit: false, canDelete: true, disabled: 'isDisabled' - },{ + },{ + id: 'security', label: '{{ _("Security") }}', + type: 'group', visible: pgAdmin.is_security_group_under_catalog + },{ id: 'acl', label: '{{ _('Privileges') }}', model: pgAdmin .Browser.Node.PrivilegeRoleModel.extend( {privileges: ['X']}), uniqueCol : ['grantee', 'grantor'], - editable: false, type: 'collection', group: '{{ _('Security') }}', + editable: false, type: 'collection', group: 'security', mode: ['edit', 'create'], canAdd: true, canDelete: true, control: 'unique-col-collection', disabled: 'isDisabled' @@ -335,7 +338,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { { id: 'seclabels', label: '{{ _('Security Labels') }}', model: SecurityModel, type: 'collection', - group: '{{ _('Security') }}', mode: ['edit', 'create'], + group: 'security', mode: ['edit', 'create'], min_version: 90100, canAdd: true, canEdit: true, canDelete: true, control: 'unique-col-collection', uniqueCol : ['provider'], diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequence/js/sequence.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequence/js/sequence.js index d070f2b..2791f57 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequence/js/sequence.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/templates/sequence/js/sequence.js @@ -58,7 +58,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { collection_type: 'coll-sequence', hasSQL: true, hasDepends: true, - parent_type: ['schema'], + parent_type: ['schema', 'catalog'], Init: function() { /* Avoid mulitple registration of menus */ if (this.initialized) @@ -203,17 +203,20 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { 'size': 'small' } },{ + id: 'security', label: '{{ _("Security") }}', + type: 'group', visible: pgAdmin.is_security_group_under_catalog + },{ id: 'acl', label: '{{ _('Privileges') }}', type: 'text', - group: '{{ _('Security') }}', mode: ['properties'], disabled: true + group: '{{ _("Security") }}', mode: ['properties'], disabled: true },{ id: 'relacl', label: '{{ _('Privileges') }}', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend( {privileges: ['r', 'w', 'U']}), uniqueCol : ['grantee', 'grantor'], - editable: false, type: 'collection', group: '{{ _('Security') }}', mode: ['edit', 'create'], + editable: false, type: 'collection', group: 'security', mode: ['edit', 'create'], canAdd: true, canDelete: true, control: 'unique-col-collection', },{ id: 'securities', label: '{{ _('Securitiy Labels') }}', model: SecurityModel, editable: false, type: 'collection', canEdit: false, - group: '{{ _('Security') }}', canDelete: true, + group: 'security', canDelete: true, mode: ['edit', 'create'], canAdd: true, control: 'unique-col-collection', uniqueCol : ['provider'], min_version: 90200 diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js index 3c3da63..9949b78 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/js/table.js @@ -712,12 +712,15 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { mode: ['edit', 'create'], schema: Backform.VacuumSettingsSchema },{ + id: 'security', label: '{{ _("Security") }}', + type: 'group', visible: pgAdmin.is_security_group_under_catalog + },{ id: 'relacl_str', label:'{{ _('Privileges') }}', cell: 'string', type: 'text', mode: ['properties'], group: '{{ _('Security') }}', disabled: 'inSchema' },{ - id: 'relacl', label: 'Privileges', type: 'collection', - group: '{{ _('Security') }}', control: 'unique-col-collection', + id: 'relacl', label: '{{ _('Privileges') }}', type: 'collection', + group: 'security', control: 'unique-col-collection', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend({ privileges: ['a','r','w','d','D','x','t']}), mode: ['edit', 'create'], canAdd: true, canDelete: true, @@ -725,7 +728,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) { },{ id: 'seclabels', label: '{{ _('Security labels') }}', model: pgAdmin.Browser.SecurityModel, editable: false, type: 'collection', - group: '{{ _('Security') }}', mode: ['edit', 'create'], + group: 'security', mode: ['edit', 'create'], min_version: 90100, canAdd: true, canEdit: false, canDelete: true, control: 'unique-col-collection' },{ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js index a22e8d5..d2fd765 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/templates/schema/js/schema.js @@ -6,84 +6,84 @@ define( function($, _, S, pgAdmin, pgBrowser, Backform, alertify) { - // VaccumSettings Collection to display all settings parameters as Grid - var VacuumCollectionControl = Backform.VacuumCollectionControl = - Backform.Control.extend({ - - grid_columns:undefined, - - initialize: function() { - Backform.Control.prototype.initialize.apply(this, arguments); - var self = this, - m = this.model; - url = self.field.get('url'); - - if (url && m.isNew()) { - var node = self.field.get('node'), - node_data = self.field.get('node_data'), - node_info = self.field.get('node_info'), - full_url = node.generate_url.apply( - node, [ - null, url, node_data, false, node_info - ]), - data; - m.trigger('pgadmin-view:fetching', m, self.field); - - // fetch default values for autovacuum fields - $.ajax({ - async: false, - url: full_url, - success: function (res) { - data = res; - }, - error: function() { - m.trigger('pgadmin-view:fetch:error', m, self.field); - } - }); - m.trigger('pgadmin-view:fetched', m, self.field); - - // Add fetched models into collection - if (data && _.isArray(data)) { - m.get(self.field.get('name')).reset(data, {silent: true}); + // VaccumSettings Collection to display all settings parameters as Grid + var VacuumCollectionControl = Backform.VacuumCollectionControl = + Backform.Control.extend({ + + grid_columns:undefined, + + initialize: function() { + Backform.Control.prototype.initialize.apply(this, arguments); + var self = this, + m = this.model; + url = self.field.get('url'); + + if (url && m.isNew()) { + var node = self.field.get('node'), + node_data = self.field.get('node_data'), + node_info = self.field.get('node_info'), + full_url = node.generate_url.apply( + node, [ + null, url, node_data, false, node_info + ]), + data; + m.trigger('pgadmin-view:fetching', m, self.field); + + // fetch default values for autovacuum fields + $.ajax({ + async: false, + url: full_url, + success: function (res) { + data = res; + }, + error: function() { + m.trigger('pgadmin-view:fetch:error', m, self.field); } + }); + m.trigger('pgadmin-view:fetched', m, self.field); + + // Add fetched models into collection + if (data && _.isArray(data)) { + m.get(self.field.get('name')).reset(data, {silent: true}); } - }, + } + }, - render: function() { - var self = this, - m = this.model, - attributes = self.field.attributes; + render: function() { + var self = this, + m = this.model, + attributes = self.field.attributes; - // remove grid - if(self.grid) { - self.grid.remove(); - delete self.grid; - self.grid = undefined; - } + // remove grid + if(self.grid) { + self.grid.remove(); + delete self.grid; + self.grid = undefined; + } - self.$el.empty(); - - var gridHeader = _.template([ - '