mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Show default database privileges in properties mode. Fixes #1538
This commit is contained in:
parent
91e3d3267f
commit
1056e9553f
@ -230,6 +230,18 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
},{
|
||||
id: 'acl', label: '{{ _('Privileges') }}', type: 'text',
|
||||
group: '{{ _('Security') }}', mode: ['properties'], disabled: true
|
||||
},{
|
||||
id: 'tblacl', label: '{{ _('Default TABLE Privileges') }}', type: 'text',
|
||||
group: '{{ _('Security') }}', mode: ['properties'], disabled: true
|
||||
},{
|
||||
id: 'seqacl', label: '{{ _('Default SEQUENCE Privileges') }}', type: 'text',
|
||||
group: '{{ _('Security') }}', mode: ['properties'], disabled: true
|
||||
},{
|
||||
id: 'funcacl', label: '{{ _('Default FUNCTION Privileges') }}', type: 'text',
|
||||
group: '{{ _('Security') }}', mode: ['properties'], disabled: true
|
||||
},{
|
||||
id: 'typeacl', label: '{{ _('Default TYPE Privileges') }}', type: 'text',
|
||||
group: '{{ _('Security') }}', mode: ['properties'], disabled: true, min_version: 90200
|
||||
},{
|
||||
id: 'comments', label:'{{ _('Comment') }}',
|
||||
editable: false, type: 'multiline'
|
||||
|
@ -5,6 +5,9 @@ SELECT
|
||||
has_database_privilege(db.oid, 'CREATE') as cancreate,
|
||||
current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description as comments,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = 0::OID) AS tblacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = 0::OID) AS seqacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = 0::OID) AS funcacl,
|
||||
array_to_string(datacl::text[], ', ') AS acl
|
||||
FROM pg_database db
|
||||
LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace=ta.OID
|
||||
|
@ -5,6 +5,10 @@ SELECT
|
||||
has_database_privilege(db.oid, 'CREATE') as cancreate,
|
||||
current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description as comments,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = 0::OID) AS tblacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = 0::OID) AS seqacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = 0::OID) AS funcacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'T' AND defaclnamespace = 0::OID) AS typeacl,
|
||||
(SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=db.oid) AS seclabels,
|
||||
array_to_string(datacl::text[], ', ') AS acl
|
||||
FROM pg_database db
|
||||
|
@ -5,6 +5,10 @@ SELECT
|
||||
has_database_privilege(db.oid, 'CREATE') as cancreate,
|
||||
current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description as comments,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'r' AND defaclnamespace = 0::OID) AS tblacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'S' AND defaclnamespace = 0::OID) AS seqacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'f' AND defaclnamespace = 0::OID) AS funcacl,
|
||||
(SELECT array_to_string(defaclacl::text[], ', ') FROM pg_default_acl WHERE defaclobjtype = 'T' AND defaclnamespace = 0::OID) AS typeacl,
|
||||
(SELECT array_agg(provider || '=' || label) FROM pg_shseclabel sl1 WHERE sl1.objoid=db.oid) AS seclabels,
|
||||
array_to_string(datacl::text[], ', ') AS acl
|
||||
FROM pg_database db
|
||||
|
Loading…
Reference in New Issue
Block a user