Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1turns-00D3xT-3p for pgadmin-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 11:41:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1turnp-002eRu-Cu for pgadmin-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 11:41:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1turnp-002eRm-1e for pgadmin-hackers@lists.postgresql.org; Wed, 19 Mar 2025 11:41:41 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1turnm-003gej-0X for pgadmin-hackers@postgresql.org; Wed, 19 Mar 2025 11:41:39 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-30bf8632052so70958481fa.0 for ; Wed, 19 Mar 2025 04:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; t=1742384496; x=1742989296; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dSWY1P4idXuQJzsTjLKsuR2RAGOck7LbXDxn7bbqm9c=; b=a49yyJHa5WveEJeXs8w3XSWJ2t1IVXTQ2P7oPpVlWIXWOQC02BpMkUQZ/AsXQ+Qkcw j/ducc5DS+JOOqCV6X76qgyix9w0V+7qRI7Lfyn+Oa0E3grpm1NhXjNdHisRGM75m6Pj 1lsl5mbOVBLtY7kgEvACjfisg7xU+Q5KsKfqoel8Vzhx0cWIZJoxLTHIEtbpmbg359Wy 4nmyDbsQQd0o3eOgRcw1kHZIJx+QTg96nql2ITDRpupfDCCA8kVl4b2ktgMNbel6Uug+ Lt6AnI3SgwP6gdoJ1hfGhCtZESmy3cyjDSSlPkx6/fUNv9ytmvgAFZzpyowouq4dg164 prsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742384496; x=1742989296; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dSWY1P4idXuQJzsTjLKsuR2RAGOck7LbXDxn7bbqm9c=; b=Lp5TXtQH7/h5MiFu1zS+u35NL4s3F2z2ThgMD2u+Qj8l/qqRgfy6G98a/DR0bsurw8 7+HmJk+fUuiK/GPPxPIjt6Jo8f55LubjLa0T4d2BBPeK6PVQvQapz2Uj/74O4Qt9COVj zUmq3FPHuV3f7SD7M5z7c2NlkHHoT0EaNMXgdqqMlpYX05gMH6FOp2olezHbGvoBkVcO 5OsAdrmqDxDHPxHmvkk7GrEecX2qWGviwmhf2Wm+Qw0GiAb25IO96tBE3PvraTHGi9yG a+3pLa7e4c6Zbfv3eaUFMq6xFdnMRbLcTiySexEhE4QqPcNZDWvJGnoWWiftSQiYy4ii /MDw== X-Gm-Message-State: AOJu0YxH9OYqipBSC+dmWc9Mf0LXLFMc3c8RaJdEhskBka35cgxwqhZa cN9NrJ3mYcHQRI2xpfEUiND4/6kUOJjESVgFUwq65PWyBBW+cBC5kYe57WV7lwSa1hZ12zpWp6k ktkv7567p+o78DTRj/MWRbTYNtfuUqA4r/Npa/1iZAoWdMlLIBg== X-Gm-Gg: ASbGnct4R+Jld3+vk50n2qSgaBGXvkh5hiq+EvJ+IOYKxm1ZyhuqhUVaYY4MtGta96N wEeQr6vkYGsHO/J7AZooQLlZHoZtWpPtQwghmwueXbGphrdnWiq+YD4wq56bao0n5zHixWqzm9n DhuDADvI3t3IhJmOzQKDHnHlCgbwoV X-Google-Smtp-Source: AGHT+IGLezfPIlG1LE2gRHJrEU9hG7U5S3zjsl2zfaHvO75bRjybV82R/PHOyRVyg2IhTpDt34Fs2aDvV4dXAjMs4FA= X-Received: by 2002:a05:6512:39c9:b0:545:27af:f2d1 with SMTP id 2adb3069b0e04-54acb21c56dmr835394e87.44.1742384496286; Wed, 19 Mar 2025 04:41:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Wed, 19 Mar 2025 11:41:25 +0000 X-Gm-Features: AQ5f1JrUgXdmX2ufgeGDFFlI_uHziXzIcTksTjpnc1IMgfW98ZItlCsNKEqvpFE Message-ID: Subject: Re: Regarding Feature #5305 To: Akshay Joshi Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000f6bb3e0630b08044" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f6bb3e0630b08044 Content-Type: text/plain; charset="UTF-8" On Wed, 19 Mar 2025 at 11:12, Akshay Joshi wrote: > Hi Dave/Hackers, > > I have started working on the feature #5305 > . Based on my > understanding, the Object Explorer should only display nodes or objects > where the currently logged-in user has at least one permission granted in > the ACL. In other words, the user must have some level of access to each > object displayed. > > For example, consider two users: 'postgres' (the default user) and 'test'. > There are objects, such as a table, where the 'test' user does not have any > permissions. This table was created by the 'postgres' user, who has revoked > all permissions for other users. Now, if the 'test' user logs into the > database server, we need to check whether the logged-in user has any > permissions on the object. If not, it should not be displayed in the Object > Explorer. > > We will have a preference for whether to apply this check or not. There > are following two solutions that can be implemented: > 1) Change the *nodes.sql* to filter out the nodes based on privileges. > It's challenging, as I tried with aclexplode(relacl), unnest(relacl) in the > WHERE clause, and other different attempts to filter out Table nodes, but > seems we will find some solution for sure). > 2) Once nodes are fetched then filter out the data at the backend. > > Any other solution or suggestion? > This seems like it would be a very large amount of work, for very little gain, and would certainly be inconsistent with how we would expect to browse files and folders for example. I do not think it is worth the effort. -- Dave Page pgAdmin: https://www.pgadmin.org PostgreSQL: https://www.postgresql.org pgEdge: https://www.pgedge.com --000000000000f6bb3e0630b08044 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, 19 Mar = 2025 at 11:12, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave/Hackers,

I have st= arted working on the feature #5305.=C2=A0Based on my understandi= ng, the Object Explorer should only display nodes or objects where the curr= ently logged-in user has at least one permission granted in the ACL. In oth= er words, the user must have some level of access to each object displayed.=

For example, consider two users: 'postgres= 9; (the default user) and 'test'. There are objects, such as a tabl= e, where the 'test' user does not have any permissions. This table = was created by the 'postgres' user, who has revoked all permissions= for other users. Now, if the 'test' user logs into the database se= rver, we need to check whether the logged-in user has any permissions on th= e object. If not, it should not be displayed in the Object Explorer.
<= div>
We will have a preference for whether to apply this chec= k or not. There are following two solutions that can be implemented:=C2=A0<= /div>
1) Change the nodes.sql to filter out the nodes based on p= rivileges. It's challenging, as I tried with aclexplode(relacl), unnest= (relacl) in the WHERE clause, and other different attempts to filter out Ta= ble nodes, but seems we will find some solution for sure).
2) Onc= e nodes are fetched then filter out the data at the backend.

=
Any other solution or suggestion? =C2=A0

This seems like it would be a very large amount of wor= k, for very little gain, and would certainly be inconsistent with how we wo= uld expect to browse files and folders for example. I do not think it is wo= rth the effort.
=C2=A0
--
--000000000000f6bb3e0630b08044--