pgsql/set-permissions.py
branchv0.7.x
changeset 644 d879f915c1c5
parent 558 2fcf12fdecc2
child 645 fcc3f100e56a
equal deleted inserted replaced
643:df1e3b67882a 644:d879f915c1c5
   117     dbc = dbh.cursor()
   117     dbc = dbh.cursor()
   118     dbc.execute('GRANT SELECT, INSERT, UPDATE, DELETE ON %s TO %s' %
   118     dbc.execute('GRANT SELECT, INSERT, UPDATE, DELETE ON %s TO %s' %
   119                 (dc_rw_tbls, db['dovecot']))
   119                 (dc_rw_tbls, db['dovecot']))
   120     dbc.execute('GRANT SELECT ON %s TO %s' % (dc_ro_tbls, db['dovecot']))
   120     dbc.execute('GRANT SELECT ON %s TO %s' % (dc_ro_tbls, db['dovecot']))
   121     dbc.execute('GRANT SELECT ON %s TO %s' % (pf_ro_tbls, db['postfix']))
   121     dbc.execute('GRANT SELECT ON %s TO %s' % (pf_ro_tbls, db['postfix']))
   122     for table, columns in db['dovecot_tbls'].iteritems():
   122     for table, columns in db['dovecot_tbls'].items():
   123         dbc.execute('GRANT SELECT (%s) ON %s TO %s' % (columns, table,
   123         dbc.execute('GRANT SELECT (%s) ON %s TO %s' % (columns, table,
   124                                                        db['dovecot']))
   124                                                        db['dovecot']))
   125     for table, columns in db['postfix_tbls'].iteritems():
   125     for table, columns in db['postfix_tbls'].items():
   126         dbc.execute('GRANT SELECT (%s) ON %s TO %s' % (columns, table,
   126         dbc.execute('GRANT SELECT (%s) ON %s TO %s' % (columns, table,
   127                                                        db['postfix']))
   127                                                        db['postfix']))
   128     dbc.close()
   128     dbc.close()
   129 
   129 
   130 
   130