Menu

#175 Showing only owned schemas

open
Permissions (5)
5
2012-02-28
2012-02-28
No

I need to show only owned schema to casual users.
The patch is quite easy and very similar to showing only owned databases.
Here it is (based on 5.0.3):

conf/config.inc.php-dist
95a96,99
> // Only show owned schemas?
> // Note: This will simply hide other schemas in the list
> $conf['owned_schema_only'] = false;
>

classes/database/Postgres.php.new
861c861
< global $conf, $slony;
---
> global $conf, $slony, $misc;
872a873,880
>
> $server_info = $misc->getServerInfo();
> if (isset($conf['owned_schema_only']) && $conf['owned_schema_only'] && !$this->isSuperUser($server_info['username'])) {
> $username = $server_info['username'];
> $this->clean($username);
> $where .= " AND pu.rolname='{$username}' ";
> }
>

Discussion


Log in to post a comment.