When config.inc.php has
$conf['owned_only'] = true;
the list of databases doesn't include any that are owned by a group in which the current user is a member.
I believe this can be handled in function getDatabase (Postgres.php) by replacing
$clause = " AND pr.rolname='{$username}'";
with
$clause = " AND (pr.rolname='{$username}'
OR (SELECT oid FROM pg_catalog.pg_roles WHERE rolname = '{$username}')
IN (SELECT member
FROM pg_catalog.pg_auth_members m
JOIN pg_catalog.pg_roles pr2 ON (m.roleid = pr2.oid)
WHERE rolname = pr.rolname))";
To reproduce this situation:
CREATE USER cathy;
CREATE USER foo_owner ROLE cathy;
-- or, after creating foo_owner: GRANT foo_owner TO cathy;
CREATE DATABASE foo WITH OWNER foo_owner;
If I log in to phpPgAdmin as foo_owner, I see database foo as expected. But, if I log in with user cathy, database foo isn't included in the list. Note that this is strictly a display issue; postgres accepts SQL commands without issue.
The above change results in showing database foo in the list for user cathy.
When config.inc.php has
the list of databases doesn't include any that are owned by a group in which the current user is a member.
I believe this can be handled in function getDatabase (Postgres.php) by replacing
with
To reproduce this situation:
If I log in to phpPgAdmin as
foo_owner, I see databasefooas expected. But, if I log in with usercathy, databasefooisn't included in the list. Note that this is strictly a display issue; postgres accepts SQL commands without issue.The above change results in showing database
fooin the list for usercathy.