Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2XHR-0004Xg-7X for pgadmin-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 10:33:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2XHQ-00077x-5P for pgadmin-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 10:33:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2XHP-00077q-Ux for pgadmin-hackers@lists.postgresql.org; Thu, 21 Jan 2021 10:33:32 +0000 Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l2XHI-0003TI-HU for pgadmin-hackers@postgresql.org; Thu, 21 Jan 2021 10:33:31 +0000 Received: by mail-yb1-xb2c.google.com with SMTP id b11so1552188ybj.9 for ; Thu, 21 Jan 2021 02:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yH+ma+VnDup8gXilnOJPF+g4adNAcN/sDYG5GDRDfIo=; b=aCcz1km7N4d0GEkU3Z+nRcy0ea7TyK4xgCQZZqT8m76lq93Sa25BR/W4Ir+RRz70u9 S2nXWh4LpBQ7O5Btw5wQFhjMP2XPhRpg0CmwsNe8RAFj+ZWvYzcoYJ0avK0uioHE2nta Ms/1fkbivGb1JdsMOGWG2X1jh4Wi9wBSy7qTVwEIQG5pRbNO1Svs9B1oyUiS8h+aKk38 Gkh6l64QDv1PkAzB+LFVb7+BQ4CaiF/pNCT2XCIdqeh5QGmWexOgrgUqsA1qP2qGtd1s DvG7Eq/Fdq/07dZHp+El8nODkPw5VMILKSXmcFX5QtO9t9bW2NIL6sfIsJDyswZ6qAnN viEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yH+ma+VnDup8gXilnOJPF+g4adNAcN/sDYG5GDRDfIo=; b=sDhmLb8E7ee9gcumwE2qdlaXa4lqb+aF0GcqPG8kFj6H6DGk203qtChv1WUZkhpR6/ v/wQ4aTFwSbdGK5iiZgtqmKH9WG+IZDqoSXof0pQ99NLA1P3BNERj2V1H94NRgjpMqGW VLIXm/ruR1AcncKNBROpLzQmBWLfuZKf/WBJlYs/qfZ8N9raHplz4ezb/DLd//hCag00 /s0PzC7C0TBSX8u4e8aTYEfe0f9dlnQ3WxsY02uL+XZJEOlc+nezFVGh5kPjX4Ohv8p4 nGT7KDCKDNqYi1dNMzPGwZaIgkcoeY+ll5It2JPYBY5K7zXdL/hHgBYiab8QrmcAq2+D gsag== X-Gm-Message-State: AOAM530AqRCW9heppEilvmcLsyKLwiIMOeFXm66kZh6pM2KNG5UC0bKo O9U1VrqNtAfA/fll6J3/6vOMbHJGf4eJtTH4wesuIUQLnyLfsxQPiNADEi+HMkriNj3FmB1fwtF FhNJUYJVhlMeoJ6xhMFLEj3JAhmACkvyULGPoKyn19Qaoc+wk4dUKkYVI3sCMdL3IMvZmGbI4JO IURIr7LdsGomXt3VWZw20nKGmbnJjDNuvI9cjfbKVvbKKm7GNrguAwb+8dow== X-Google-Smtp-Source: ABdhPJzj29xuQr/3zNgJZc55J6K5xep0C8UlW3DW+YOhb5dhQ718Oui9eQYwYKZMedNeCbYWkj2PsOSHe8KS/aCXkPM= X-Received: by 2002:a25:8e02:: with SMTP id p2mr20618925ybl.416.1611225202668; Thu, 21 Jan 2021 02:33:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nikhil Mohite Date: Thu, 21 Jan 2021 16:03:11 +0530 Message-ID: Subject: Re: [pgAdmin][RM-6143]: Shared server entries not getting deleted. To: Akshay Joshi Cc: Dave Page , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000dbca2705b96699a9" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000dbca2705b96699a9 Content-Type: text/plain; charset="UTF-8" Hi Dave, On Thu, Jan 21, 2021 at 3:24 PM Akshay Joshi wrote: > Reverted the commit. > > On Thu, Jan 21, 2021 at 3:13 PM Dave Page wrote: > >> This seems like a very bad idea. What if the user that has left was the >> user that setup 50 connections used by everyone else? >> >> Deleting those shared entries is (I would guess) most likely *not* what >> the majority of users would want, and the current behaviour is definitely >> safest. >> > In the current implementation when the admin user gets deleted all "*Server groups*" created by that user are getting deleted, so if that admin has created any *Shared server* other users are not able to access it as its server group is not present in the database. > >> We should make this optional; i.e. ask the use if they want shared >> servers created by the user to be deleted. If they say no, they should be >> reassigned to another user; either the admin that's deleting the user, or >> their choice of user (a little more complex of course, but more flexible). >> > In the shared server table, we are creating entries per user, for deletion of non-admin user we can delete the shared server tables entries as it will not affect any other users. (because only admin users can mark the server as shared.) In case of admin user deletion, will add an extra check as suggested. > >> > >> Please revert this, until the deletion is made optional. >> >> On Thu, Jan 21, 2021 at 9:23 AM Akshay Joshi < >> akshay.joshi@enterprisedb.com> wrote: >> >>> Thanks, patch applied. >>> >>> On Thu, Jan 21, 2021 at 12:18 PM Nikhil Mohite < >>> nikhil.mohite@enterprisedb.com> wrote: >>> >>>> Hi Team, >>>> >>>> Please find the attached patch for RM-6143 >>>> : Shared server entries >>>> not getting deleted. >>>> Added code to delete shared server entries if the admin deletes the >>>> user from user management. >>>> >>>> >>>> -- >>>> *Thanks & Regards,* >>>> *Nikhil Mohite* >>>> *Software Engineer.* >>>> *EDB Postgres* >>>> *Mob.No: +91-7798364578.* >>>> >>> >>> >>> -- >>> *Thanks & Regards* >>> *Akshay Joshi* >>> *pgAdmin Hacker | Principal Software Architect* >>> *EDB Postgres * >>> >>> *Mobile: +91 976-788-8246* >>> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EDB: http://www.enterprisedb.com >> >> > > -- > *Thanks & Regards* > *Akshay Joshi* > *pgAdmin Hacker | Principal Software Architect* > *EDB Postgres * > > *Mobile: +91 976-788-8246* > Regards, Nikhil Mohite. --000000000000dbca2705b96699a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dave,

On Thu, Jan 21, 2021 at 3:24 = PM Akshay Joshi <akshay= .joshi@enterprisedb.com> wrote:
Reverted the commit.

On Thu, Jan 21,= 2021 at 3:13 PM Dave Page <dpage@pgadmin.org> wrote:
This seems like a very bad id= ea. What if the user that has left was the user that setup 50 connections u= sed by everyone else?

Deleting those shared entries is (= I would guess) most likely=C2=A0*not* what the majority of users would want= , and the current behaviour is definitely safest.
<= /div>
In the current implementation when the admin user ge= ts deleted all "Server groups" created by that user are ge= tting deleted, so if that admin has created any Shared server other = users are not able to access it as its server group is not present in the d= atabase.

We should make this optional; i.e. ask the use= if they want shared servers created by the user to be deleted. If they say= no, they should be reassigned to another user; either the admin that's= deleting the user, or their choice of user (a little more complex of cours= e, but more flexible).
In t= he shared server table, we are creating entries per user, for deletion of n= on-admin user we can delete the shared server tables entries as it will not= affect=C2=A0any other users. (because only admin users can mark the server= as shared.)=C2=A0
In case of admin user deletion, will add an ex= tra check as suggested.
=C2=A0

Please revert this, until the deletion is made= optional.=C2=A0

On Thu, Jan 21, 2021 at 9:23 AM Akshay Joshi <akshay.joshi= @enterprisedb.com> wrote:
Thanks, patch applied.

On Thu, Jan 21, 202= 1 at 12:18 PM Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:
<= /div>
Hi = Team,

Please find the attached patch for RM-6143:=C2= =A0Shared server entries not getting deleted.
Added code to delet= e shared server entries if the admin deletes the user from user management.=


--
<= font face=3D"verdana, sans-serif">Thanks & Regards,
<= font face=3D"verdana, sans-serif">Nikhil Mohite
Software Engineer.
Mob.No: +91-7798364578.


--
Thank= s & Regards
Akshay Joshi
pgAdmin Hacker | Principal Softw= are Architect
EDB Po= stgres
Mobile: +91 976-788-8246



--


--
Thank= s & Regards
Akshay Joshi
pgAdmin Hacker | Principal Softw= are Architect
EDB Po= stgres
Mobile: +91 976-788-8246

Regards,
N= ikhil Mohite.=C2=A0
--000000000000dbca2705b96699a9--