views:

108

answers:

1

Hi,

In our current project, a system that will run on a local network with no more than 50 clients that connects to the same local server, we are creating a DB user for each client, to take advantage of the postgresql privilege system.

I have some questions about this situation:

1) Analyzing the "performance", its OK to have ~ 50 DB users instead of reimplementing a custom system?

2) (SOLVED) How can the user check (what SQL statement) what permission he has in a table?

Solution:

SELECT HAS_TABLE_PRIVILEGE('user','table','insert')

I prefer to not reimplement the system, since a good security system isn't trivial to implement.

+1  A: 

To answer the user/performance question: probably not. The only real risk would depend on how many users have unique security permissions (for example, if every one of those 50 users had different permissions on each table/schema in the database). In practice this should never happen, and as long as you have a sane group system for permissions, you should be fine.

rmw1985