public inbox for [email protected]  
help / color / mirror / Atom feed
PATCH: Do not display 'CREATE Script' on Server-group & Server node (pgAdmin4)
2+ messages / 2 participants
[nested] [flat]

* PATCH: Do not display 'CREATE Script' on Server-group & Server node (pgAdmin4)
@ 2016-09-23 06:27  Murtuza Zabuawala <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Murtuza Zabuawala @ 2016-09-23 06:27 UTC (permalink / raw)
  To: pgadmin-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) {


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PATCH: Do not display 'CREATE Script' on Server-group & Server node (pgAdmin4)
@ 2016-09-23 09:07  Dave Page <[email protected]>
  parent: Murtuza Zabuawala <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-09-23 09:07 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Fri, Sep 23, 2016 at 7:27 AM, Murtuza Zabuawala
<[email protected]> wrote:
> 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
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: 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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-09-23 09:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 06:27 PATCH: Do not display 'CREATE Script' on Server-group & Server node (pgAdmin4) Murtuza Zabuawala <[email protected]>
2016-09-23 09:07 ` Dave Page <[email protected]>

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