User Auth.

From: Peter Jackson <tasmaniac(at)iprimus(dot)com(dot)au>
To: pgsql <pgsql-novice(at)postgresql(dot)org>
Subject: User Auth.
Date: 2008-02-04 12:28:59
Message-ID: 47A7050B.9030103@iprimus.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Browse pgsql-novice by date

  From Date Subject
Next Message Alex du Plessis 2008-02-05 13:42:28 What happened to libpq.dll
Previous Message richard terry 2008-02-03 21:36:57 Trouble putting boolean values into postgres