pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Trent Pingenot <pintj@hotmail.com>
To: pgsql-admin@postgresql.org
Subject: Permissions Scenerio
Date: Mon, 15 Sep 2008 15:07:22 -0600
Message-ID: <BAY105-W1914C2300B5F700EB8BC82A6520@phx.gbl> (raw)

Hello list,

I've been a PostGres user for a while, but am just now having to implement some security for a project.  The hope is that we can create an environment through Roles that would allow users the ability to create a database(s) and have access to their database(s) but not have access to others' databases. I've been able to get part of the way there to create a user with createDB privileges and recording them in the pg_hba.conf file. However, when my test user creates a new database, they are the owner of that database but can't use it.  Is there a way to avoid having to add user /database entry in
the pg_hba.conf file every time a user creates a new database?

Here is the current hba conf file I have

host    all         postgres         127.0.0.1/32          md5  # Super user admin account
host    samerole         testuser         127.0.0.1/32          md5
host    template_db         all         127.0.0.1/32          md5

Under this conf file my testuser can create a new db, but then doesn't have access to it b/c no entry exsists in the conf file.  

This is probably an easy change but being new to PostGres security I'm not seeing it. 

If I can't do this with Roles, can I do it with schemas to give users only access to their own stuff within a database?

Thanks in advance for any guidance

- Trent

view thread (2+ messages)  latest in thread

Message-ID: <BAY105-W1914C2300B5F700EB8BC82A6520@phx.gbl>
Permalink:  ../BAY105-W1914C2300B5F700EB8BC82A6520@phx.gbl/
Also on:    postgresql.org/message-id/BAY105-W1914C2300B5F700EB8BC82A6520@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pintj@hotmail.com
  Subject: Re: Permissions Scenerio
  In-Reply-To: <BAY105-W1914C2300B5F700EB8BC82A6520@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox