Subject: [pgAdmin4][Patch] - Disable PrivilegeControl for nodes visible under catalog

From: Surinder Kumar <[email-masked]>
Date: Thu, 7 Apr 2016 13:15:11 +0530

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-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Dave Page <[email-masked]>
Date: Thu, 7 Apr 2016 11:14:56 +0100

Hi

On Thu, Apr 7, 2016 at 8:45 AM, Surinder Kumar
<[email-masked]> wrote:
> Change: Add check to disable PrivilegeRoleModel fields for nodes visible
> under catalog.
>
> Please review the patch.

I'm unclear what this is supposed to do:

- Those fields already seem to be disabled under catalog nodes (though
- the Add button on subnode grids is still active, but doesn't do
anything)

- Shouldn't we just hide privilege info on those nodes directly? Why
break modularity for this?

- I'm seeing weird effects after applying this patch - see the
attached screenshot. However, that issue remains even after I remove
it again (and restart the server, and hard-reload). It does seem to
fix itself eventually, but I'm not sure what causes that. If I try to
refresh the Functions node, I get:

jquery.contextMenu.js:309 No items specified to show in
contextMenuhandle.contextmenu @
jquery.contextMenu.js:309jQuery.event.dispatch @
jquery-1.11.2.js:4665elemData.handle @ jquery-1.11.2.js:4333
jquery.contextMenu.js:312 Uncaught Error: No Items
specifiedhandle.contextmenu @
jquery.contextMenu.js:312jQuery.event.dispatch @
jquery-1.11.2.js:4665elemData.handle @ jquery-1.11.2.js:4333

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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Surinder Kumar <[email-masked]>
Date: Thu, 7 Apr 2016 15:52:32 +0530

It seems you forgot to attach screenshot.
Please send.

---

From: Dave Page <[email-masked]>
Date: Thu, 7 Apr 2016 11:23:28 +0100

This time, with the screenshot...

---

From: Surinder Kumar <[email-masked]>
Date: Mon, 11 Apr 2016 13:11:40 +0530

Hi Dave,

Please ignore the above patch because instead of disabling fields, now we
are hiding the control.

As per my conversation with Ashesh, In some cases we need not to show
"Group Tab" if its all fields are set to visible = false.
For example: In case of view, "privilege info and security labels" need not
to show under catalogs. so Its group tab "Security" should also disappear.

Please find attached patch and review it.

> > break modularity for this?

Yes instead of disabling privilege info, it is better to hide privilege
info.
I have attached the patch for it.

> > jquery-1.11.2.js:4665elemData.handle @ jquery-1.11.2.js:4333
I have applied the same patch but functions node under schema and catalogs
are working fine.