public inbox for [email protected]
help / color / mirror / Atom feedFrom: Pradip Parkale <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server.
Date: Fri, 29 Oct 2021 13:05:36 +0530
Message-ID: <CAJ9T6SvZPH-7wOzg7Fubeukb2nvq4YjZO-C5-YiaEhVuk9vPsw@mail.gmail.com> (raw)
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;
view thread (2+ 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: [pgAdmin][RM6940]: Pop for user details is not shown when non-admin user tries to connect shared server.
In-Reply-To: <CAJ9T6SvZPH-7wOzg7Fubeukb2nvq4YjZO-C5-YiaEhVuk9vPsw@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