m1nld3zz
m1nld3zz

Reputation: 33

PostgreSQL, how can i restrict access to code in a function for a user?

I found out how to deny all access to tables for user in a schema.

REVOKE ALL PRIVILEGES ON SCHEMA test FROM user;

But what can i do to restrict access to all functions in a schema, so that user couldn't read the code?

I was trying this:

REVOKE ALL ON FUNCTION test.test_function(text) FROM user;

Yes, it has restricted the ability to change a function, but not to actually see it.

What have i missed?

Upvotes: 3

Views: 3067

Answers (1)

Frank Heikens
Frank Heikens

Reputation: 127031

REVOKE access to the system view pg_proc or at least the column prosrc that hase the source code for the function.

Upvotes: 2

Related Questions