Fixed an issue where user details are not shown when the non-admin user tries

to connect to the shared server. Fixes #6940
pull/6173/head
Pradip Parkale 2021-10-29 16:26:11 +05:30 committed by Akshay Joshi
parent f71e2e8040
commit fa8b3edda5
3 changed files with 3 additions and 4 deletions

View File

@ -22,4 +22,5 @@ Bug fixes
| `Issue #6780 <https://redmine.postgresql.org/issues/6780>`_ - Ensure that columns should be merged if the newly added column is present in the parent table.
| `Issue #6809 <https://redmine.postgresql.org/issues/6809>`_ - Fixed an issue where pgAdmin is not opening properly.
| `Issue #6859 <https://redmine.postgresql.org/issues/6859>`_ - Fixed an issue where properties panel is not updated when any object is added from the browser tree.
| `Issue #6940 <https://redmine.postgresql.org/issues/6940>`_ - Fixed an issue where user details are not shown when the non-admin user tries to connect to the shared server.
| `Issue #6949 <https://redmine.postgresql.org/issues/6949>`_ - Ensure that dialog should be opened when clicking on Reassign/Drop owned menu.

View File

@ -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'}
);

View File

@ -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;