freeside/bin pg-readonly,NONE,1.1
ivan
ivan at pouncequick.420.am
Fri Feb 25 14:08:00 PST 2005
Update of /home/cvs/cvsroot/freeside/bin
In directory pouncequick:/tmp/cvs-serv30042
Added Files:
pg-readonly
Log Message:
adding quick pg-readonly tool
--- NEW FILE: pg-readonly ---
#!/usr/bin/perl
#
# hack to update/add read-only permissions for a user on the db
#
# usage: pg-readonly freesideuser readonlyuser
use strict;
use DBI;
use FS::UID qw(adminsuidsetup);
use FS::Record qw(dbdef);
my $user = shift or die &usage;
my $rouser = shift or die &usage;
my $dbh = adminsuidsetup $user;
foreach my $table ( dbdef->tables ) {
$dbh->do("GRANT SELECT ON $table TO $rouser");
$dbh->commit();
$dbh->do("GRANT SELECT ON ${table}_seq TO $rouser");
$dbh->commit();
}
More information about the freeside-commits
mailing list