Hot to restrict access to subset of data

Поиск
Список
Период
Сортировка
От Andrus
Тема Hot to restrict access to subset of data
Дата
Msg-id da3979$27os$1@news.hub.org
обсуждение исходный текст
Ответы Re: Hot to restrict access to subset of data  (Michael Fuhr <mike@fuhr.org>)
Re: Hot to restrict access to subset of data  (Gregory Youngblood <gsyoungblood@mac.com>)
Список pgsql-general
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.



В списке pgsql-general по дате отправления:

Предыдущее
От: Ajay Dalvi
Дата:
Сообщение: How to uninstall PostGreSql from linux
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL sequence within function