Restrict permissions on schema to hide pl/pgsql code - Mailing list pgsql-admin

From Swanand Kshirsagar
Subject Restrict permissions on schema to hide pl/pgsql code
Date
Msg-id CAMn6ZARbP+r=AdDpFG1xC217=+mMVOsqnVBLL4Pf+ktDJt33gA@mail.gmail.com
Whole thread Raw
Responses Re: Restrict permissions on schema to hide pl/pgsql code  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-admin
Hi,

I have a situation where customer is using multi-tenant architecture in the PostgreSQL database i.e. one schema is for one customer. Now, I have revoked USAGE permissions from user 'B' on schema 'A' so that user B cannot query on tables in schema A. This is working as expected. But, when my user is connecting through pgAdmin (pgAdmin 3 in this case), User B can view and copy the code for functions/procedures/triggers etc. This is critical, other users should not have ANY access to schema when I revoke usage permissions from it.

I tried revoking all permissions from pg_proc for user B and then when user B clicks on any function in schema A an error is thrown (thus, working as expected). But, I am afraid, revoking privileges on catalog tables is not a best approach as it will impact using any other functions as well.

Isn't revoking permissions from a schema should take care of this situation? Kindly guide.

pgsql-admin by date:

Previous
From: Mariel Cherkassky
Date:
Subject: pg_locks relation cant be found in pg_class
Next
From: "David G. Johnston"
Date:
Subject: Re: Restrict permissions on schema to hide pl/pgsql code