Search Postgresql Archives

Hot to restrict access to subset of data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have table of documents

CREATE TABLE document ( DocumentType CHARACTER(1), .... )

DocumentType field determines the document type stored in record.

I want to restrict access to this table based on the user name, document 
type and access level. I have 3 levels: no access, view only, modify access.

Example:

User A can only view documents of type X and modify documents of type Y
User B can only view documents of type Z

I created application which implements those restictions.

Unfortunately, users can run pgAdmin and bypass the access restrictions.

I'm thinking about two solutions:

1. Postgres should automatically modify WHERE clauses to apply restrictions
based on user name.

For example, if user A runs query from pgAdmin

SELECT * FROM document

Postgres should actually run the query

SELECT * FROM document WHERE DocumentType IN ('X','Y')

2. Postgres should allow access from my application only. Is it possible to 
use authentication method which allows access from my application only ?

Users connect to 5432 port from internet.
I'm using Postgres 8 in Windows from Windows ODBC clients.

Any idea how to implement this ?

Andrus.



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux