public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server.
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server.
@ 2021-10-29 07:35 Pradip Parkale <[email protected]>
  2021-10-29 10:57 ` Re: [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server. Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Pradip Parkale @ 2021-10-29 07:35 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch for #6940 Pop for user details is not shown
when non-admin user tries to connect to a shared server.



-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/octet-stream] RM6940.patch (1.9K, 3-RM6940.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index afb850d46..8d2213a4f 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -813,14 +813,12 @@ define('pgadmin.node.server', [
 
     var connect_to_server = function(obj, data, tree, item, reconnect) {
     // Open properties dialog in edit mode
-      const selectedTreeNode = tree.selected().length > 0 ? tree.selected() : tree.first();
-      const selectedTreeNodeData = selectedTreeNode && selectedTreeNode.length === 1 ? tree.itemData(selectedTreeNode) : undefined;
       var server_url = obj.generate_url(item, 'obj', data, true);
       // Fetch the updated data
       $.get(server_url)
         .done(function(res) {
           if (res.shared && _.isNull(res.username) && data.user_id != current_user.id){
-            if (selectedTreeNodeData._type == 'server' && !res.service){
+            if (!res.service){
               pgAdmin.Browser.Node.callbacks.show_obj_properties.call(
                 pgAdmin.Browser.Nodes[tree.itemData(item)._type], {action: 'edit'}
               );
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js b/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js
index f54ea0941..7f8202846 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.ui.js
@@ -143,7 +143,7 @@ export default class ServerSchema extends BaseUISchema {
         mode: ['properties', 'create', 'edit'],
         readonly: function(state){
           var serverOwner = obj.userId;
-          if (obj.isNew(state) && serverOwner != current_user.id) {
+          if (!obj.isNew(state) && serverOwner != current_user.id) {
             return true;
           }
           return false;


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

* Re: [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server.
  2021-10-29 07:35 [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server. Pradip Parkale <[email protected]>
@ 2021-10-29 10:57 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-10-29 10:57 UTC (permalink / raw)
  To: Pradip Parkale <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Fri, Oct 29, 2021 at 1:05 PM Pradip Parkale <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch for #6940 Pop for user details is not shown
> when non-admin user tries to connect to a shared server.
>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


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


end of thread, other threads:[~2021-10-29 10:57 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 07:35 [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server. Pradip Parkale <[email protected]>
2021-10-29 10:57 ` Akshay Joshi <[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