From fa8b3edda52413039bb6d48191d027c05ff44ad2 Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Fri, 29 Oct 2021 16:26:11 +0530 Subject: [PATCH] Fixed an issue where user details are not shown when the non-admin user tries to connect to the shared server. Fixes #6940 --- docs/en_US/release_notes_6_2.rst | 1 + web/pgadmin/browser/server_groups/servers/static/js/server.js | 4 +--- .../browser/server_groups/servers/static/js/server.ui.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/en_US/release_notes_6_2.rst b/docs/en_US/release_notes_6_2.rst index b3eb13839..f4009e6e2 100644 --- a/docs/en_US/release_notes_6_2.rst +++ b/docs/en_US/release_notes_6_2.rst @@ -22,4 +22,5 @@ Bug fixes | `Issue #6780 `_ - Ensure that columns should be merged if the newly added column is present in the parent table. | `Issue #6809 `_ - Fixed an issue where pgAdmin is not opening properly. | `Issue #6859 `_ - Fixed an issue where properties panel is not updated when any object is added from the browser tree. +| `Issue #6940 `_ - Fixed an issue where user details are not shown when the non-admin user tries to connect to the shared server. | `Issue #6949 `_ - Ensure that dialog should be opened when clicking on Reassign/Drop owned menu. 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;