public inbox for [email protected]  
help / color / mirror / Atom feed
From: Murtuza Zabuawala <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: PATCH: Do not display 'CREATE Script' on Server-group & Server node (pgAdmin4)
Date: Fri, 23 Sep 2016 11:57:04 +0530
Message-ID: <CAKKotZTbG1iJ62pbC5kuhNKvkSSq+UQWCTV8tEFcqq2Un9CS3Q@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi,

PFA minor patch to fix the issue where we were displaying 'CREATE Script'
on Server-group & Server node.
RM#1578


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM_1578.patch (1.3K, 3-RM_1578.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js
index 8213c74..07f8a82 100644
--- a/web/pgadmin/browser/templates/browser/js/node.js
+++ b/web/pgadmin/browser/templates/browser/js/node.js
@@ -148,7 +148,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
               applies: ['object', 'context'], callback: 'show_script',
               priority: 4, label: type_label, category: 'Scripts',
               data: {'script': stype}, icon: 'fa fa-pencil',
-              enable: this.check_user_permission
+              enable: self.check_user_permission
             }]);
           });
       }
@@ -160,6 +160,10 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
     // if no permission matched then do not allow create script
     ///////
     check_user_permission: function(itemData, item, data) {
+      // Do not display CREATE script on server group and server node
+      if(itemData._type == 'server-group' || itemData._type == 'server') {
+        return false;
+      }
       var node = pgBrowser.Nodes[itemData._type],
         parentData = node.getTreeNodeHierarchy(item);
       if ( _.indexOf(['create','insert','update', 'delete'], data.script) != -1) {


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: PATCH: Do not display 'CREATE Script' on Server-group & Server node (pgAdmin4)
  In-Reply-To: <CAKKotZTbG1iJ62pbC5kuhNKvkSSq+UQWCTV8tEFcqq2Un9CS3Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox