mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Integrate superuser check into has_rolreplication()
This makes it consistent with similar functions like has_createrole_privilege() and allows removing some explicit superuser checks. Author: Nathan Bossart <nathandbossart@gmail.com> Discussion: https://www.postgresql.org/message-id/20230310000313.GA3992372%40nathanxps13
This commit is contained in:
@@ -709,6 +709,10 @@ has_rolreplication(Oid roleid)
|
||||
bool result = false;
|
||||
HeapTuple utup;
|
||||
|
||||
/* Superusers bypass all permission checking. */
|
||||
if (superuser_arg(roleid))
|
||||
return true;
|
||||
|
||||
utup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleid));
|
||||
if (HeapTupleIsValid(utup))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user