Обсуждение: Granting access

Поиск
Список
Период
Сортировка

Granting access

От
Bill Moseley
Дата:
I'm wondering if there's an easier way to grant access to a database to
other users.

I create a database and create tables under my own account "moseley",
so "moseley" is the owner of the objects.

Now, I want to provide access to another user "otheruser".  So I setup
the pg_hba.conf file for authentication (in this case I'm using md5).
"otheruser" will actually be the web server accessing the database via a
username and password.

"otheruser" can connect to the database and create objects, but cannot access
the objects created my user "moseley".

So, I have to go in as user moseley and for every object I have do:

  grant all on table inventory to otheruser;
  grant all on table inventory_id_seq otheruser;
  [...]

I want "otheruser" to have the same permissions as user "moseley", so is
there an easy way to grant this access on all objects?

Is there a way to say any new objects will also have the same
permissions, too?  That is, if later "moseley" creates a new table that
"otheruser" will automatically have access to that table?






--
Bill Moseley
moseley@hank.org