mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Add new GUC createrole_self_grant.
Can be set to the empty string, or to either or both of "set" or "inherit". If set to a non-empty value, a non-superuser who creates a role (necessarily by relying up the CREATEROLE privilege) will grant that role back to themselves with the specified options. This isn't a security feature, because the grant that this feature triggers can also be performed explicitly. Instead, it's a user experience feature. A superuser would necessarily inherit the privileges of any created role and be able to access all such roles via SET ROLE; with this patch, you can configure createrole_self_grant = 'set, inherit' to provide a similar experience for a user who has CREATEROLE but not SUPERUSER. Discussion: https://postgr.es/m/CA+TgmobN59ct+Emmz6ig1Nua2Q-_o=r6DSD98KfU53kctq_kQw@mail.gmail.com
This commit is contained in:
@@ -3949,6 +3949,18 @@ struct config_string ConfigureNamesString[] =
|
||||
check_temp_tablespaces, assign_temp_tablespaces, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"createrole_self_grant", PGC_USERSET, CLIENT_CONN_STATEMENT,
|
||||
gettext_noop("Sets whether a CREATEROLE user automatically grants "
|
||||
"the role to themselves, and with which options."),
|
||||
NULL,
|
||||
GUC_LIST_INPUT
|
||||
},
|
||||
&createrole_self_grant,
|
||||
"",
|
||||
check_createrole_self_grant, assign_createrole_self_grant, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"dynamic_library_path", PGC_SUSET, CLIENT_CONN_OTHER,
|
||||
gettext_noop("Sets the path for dynamically loadable modules."),
|
||||
|
||||
@@ -703,6 +703,7 @@
|
||||
#xmlbinary = 'base64'
|
||||
#xmloption = 'content'
|
||||
#gin_pending_list_limit = 4MB
|
||||
#createrole_self_grant = '' # set and/or inherit
|
||||
|
||||
# - Locale and Formatting -
|
||||
|
||||
|
||||
Reference in New Issue
Block a user