public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch] - Disable PrivilegeControl for nodes visible under catalog
Date: Thu, 7 Apr 2016 13:15:11 +0530
Message-ID: <CAM5-9D98_=ZS2K42VGqH69GiZ+ozv0Yu8vkQK3rzeZ-0LFGpNw@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi,

PFA minor patch for PrivilegeRoleModel

*Change*: Add check to disable PrivilegeRoleModel fields for nodes visible
under catalog.

Please review the patch.


Thanks,
Surinder Kumar


-- 
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] disable_privilege_control_for_nodes_under_catalog.patch (1.2K, 3-disable_privilege_control_for_nodes_under_catalog.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/privilege.js b/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
index 0a99fa3..6f0fc68 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
@@ -78,6 +78,10 @@
           // This has been called during generating the header cell
           return false;
         }
+        if (m.top.node_info && 'catalog' in m.top.node_info) {
+          // Disable the control if it is under catalog
+          return true;
+        }
         return !(
           m.top && m.top.node_info &&
           m.top.node_info.server.user.name == m.get('grantor')
@@ -172,6 +176,10 @@
           // This has been called during generating the header cell
           return false;
         }
+        if (column.handler.node_info && 'catalog' in column.handler.node_info) {
+          // Disable the control if it is under catalog
+          return true;
+        }
         return !(this.node_info && this.node_info.server.user.name == column.get('grantor') ||
                 this.attributes.node_info.server.user.name == column.get('grantor'));
       }


view thread (5+ 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: [pgAdmin4][Patch] - Disable PrivilegeControl for nodes visible under catalog
  In-Reply-To: <CAM5-9D98_=ZS2K42VGqH69GiZ+ozv0Yu8vkQK3rzeZ-0LFGpNw@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