mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Allow selection of 'PUBLIC' as a role in privileges. Fixes #1416
This commit is contained in:
committed by
Dave Page
parent
ae692d2416
commit
f79ca32e45
@@ -37,6 +37,10 @@ def parse_priv_to_db(str_privileges, allowed_acls=[]):
|
||||
"""
|
||||
Common utility function to parse privileges before sending to database.
|
||||
"""
|
||||
from pgadmin.utils.driver import get_driver
|
||||
from config import PG_DEFAULT_DRIVER
|
||||
driver = get_driver(PG_DEFAULT_DRIVER)
|
||||
|
||||
db_privileges = {
|
||||
'c': 'CONNECT',
|
||||
'C': 'CREATE',
|
||||
@@ -82,7 +86,8 @@ def parse_priv_to_db(str_privileges, allowed_acls=[]):
|
||||
priv_without_grant = ['ALL']
|
||||
# Appending and returning all ACL
|
||||
privileges.append({
|
||||
'grantee': priv['grantee'],
|
||||
'grantee': driver.qtIdent(None, priv['grantee'])
|
||||
if priv['grantee'] != 'PUBLIC' else 'PUBLIC',
|
||||
'with_grant': priv_with_grant,
|
||||
'without_grant': priv_without_grant
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user