|
|
@ -460,18 +460,18 @@ class Connection(object):
|
|
|
|
# set_what: SQL-fragment specifying what to set for the target roles:
|
|
|
|
# set_what: SQL-fragment specifying what to set for the target roles:
|
|
|
|
# Either group membership or privileges on objects of a certain type
|
|
|
|
# Either group membership or privileges on objects of a certain type
|
|
|
|
if obj_type == 'group':
|
|
|
|
if obj_type == 'group':
|
|
|
|
set_what = ','.join(pg_quote_identifiers(i, 'role') for i in obj_ids)
|
|
|
|
set_what = ','.join(pg_quote_identifier(i, 'role') for i in obj_ids)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Note: obj_type has been checked against a set of string literals
|
|
|
|
# Note: obj_type has been checked against a set of string literals
|
|
|
|
# and privs was escaped when it was parsed
|
|
|
|
# and privs was escaped when it was parsed
|
|
|
|
set_what = '%s ON %s %s' % (','.join(privs), obj_type,
|
|
|
|
set_what = '%s ON %s %s' % (','.join(privs), obj_type,
|
|
|
|
','.join(pg_quote_identifiers(i, 'table') for i in obj_ids))
|
|
|
|
','.join(pg_quote_identifier(i, 'table') for i in obj_ids))
|
|
|
|
|
|
|
|
|
|
|
|
# for_whom: SQL-fragment specifying for whom to set the above
|
|
|
|
# for_whom: SQL-fragment specifying for whom to set the above
|
|
|
|
if roles == 'PUBLIC':
|
|
|
|
if roles == 'PUBLIC':
|
|
|
|
for_whom = 'PUBLIC'
|
|
|
|
for_whom = 'PUBLIC'
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
for_whom = ','.join(pg_quote_identifiers(r, 'role') for r in roles)
|
|
|
|
for_whom = ','.join(pg_quote_identifier(r, 'role') for r in roles)
|
|
|
|
|
|
|
|
|
|
|
|
status_before = get_status(objs)
|
|
|
|
status_before = get_status(objs)
|
|
|
|
if state == 'present':
|
|
|
|
if state == 'present':
|
|
|
|