User Auth. - Mailing list pgsql-novice

From Peter Jackson
Subject User Auth.
Date
Msg-id 47A7050B.9030103@iprimus.com.au
Whole thread Raw
List pgsql-novice
Hello list,

  OK I'm not sure if this is a PHP or Postgres related question.

  I'm trying to set up php pages to access postgres database.

   1/ What I want to do is if User A is logged in and accesses a
database that he/she has read/write access to show the page with all
controls.

  2/ If User A is NOT logged full back to a 'default' user with read
only access.

  3/ If User A IS logged in but has not got read/write access to the
database fall back to default user with read only access to certain areas.

  I have succeeded in 1 and 2 but am running into problems with 3. In
one database it works as I expect (ie php does check if user logged in
if yes try and connect with username pass if no use the default username
pass. If user not logged in use the default username and pass).

  But then in another database if user is logged in it will only try
their  username pass and then return a 'you dont have access to schema
blah blah' . But if they arent logged in it uses the default user/pass
as expected.

  Reason I'm trying to do it the way I am is so that the web page
(intranet) doesnt display the editing commands if they arent authorised
to edit the records but its ok for them to view it.

  Is there any system table in postgre that I can query via php that
returns whether user has read/write or read only access?

  Or has anyone succeed in what I'm trying to do and can point me in the
right direction?

  TIA

  Peter.




pgsql-novice by date:

Previous
From: richard terry
Date:
Subject: Trouble putting boolean values into postgres
Next
From: Alex du Plessis
Date:
Subject: What happened to libpq.dll