From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Postgres Enhancement Request
Date: Wed, 20 Mar 2019 11:44:38 +0100
Message-ID: <49902029-5742-00ba-85bd-fd0ba0b7d5f3@gmx.net> (raw)
In-Reply-To: <de9a4bb5fc70414caa68330aef5f843b@zuerich.ch>
References: <de9a4bb5fc70414caa68330aef5f843b@zuerich.ch>
Zwettler Markus (OIZ) schrieb am 20.03.2019 um 11:10:
> CREATEROLE allows users to create new roles also having the CREATEDB privilege (at least in version 9.6).
>
> We want special users to be able to CREATEROLE without being able to CREATEDB (eg. when usermanagement is done by the application itself).
>
> Please prevent users with CREATEROLE to create roles having CREATEDB (analogous SUPERUSER and REPLICATION).
I agree that would be a welcome enhancement.
As a workaround, you can create a function owned by a superuser (or any other user with the "createrole" privilege) using "security definer" that provides a simple "create user" capability and makes sure that the created user does not have the createdb privilege.
The user/role that should be able to create new roles doesn't need the createrole privilege at all then.
All it needs is the execute privilege on the function.
Thomas
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: Postgres Enhancement Request
In-Reply-To: <49902029-5742-00ba-85bd-fd0ba0b7d5f3@gmx.net>
References: <de9a4bb5fc70414caa68330aef5f843b@zuerich.ch> <49902029-5742-00ba-85bd-fd0ba0b7d5f3@gmx.net>
* 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