summaryrefslogtreecommitdiff
path: root/bin/pg-readonly
diff options
context:
space:
mode:
authorcvs2git <cvs2git>2008-03-16 19:58:34 +0000
committercvs2git <cvs2git>2008-03-16 19:58:34 +0000
commiteb061f5119325e666f0dff40d4089e5c1df58e17 (patch)
treed55e8fef5aca62eb13bbc8ad20dbdf941c3bd266 /bin/pg-readonly
parent3a17b276638200475d54201fa62566b7440e819a (diff)
This commit was manufactured by cvs2svn to create tag 'TRIXBOX_2_6'.TRIXBOX_2_6
Diffstat (limited to 'bin/pg-readonly')
-rw-r--r--bin/pg-readonly24
1 files changed, 0 insertions, 24 deletions
diff --git a/bin/pg-readonly b/bin/pg-readonly
deleted file mode 100644
index ad69fbde2..000000000
--- a/bin/pg-readonly
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/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();
- if ( my $pkey = dbdef->table($table)->primary_key ) {
- $dbh->do("GRANT SELECT ON ${table}_${pkey}_seq TO $rouser");
- $dbh->commit();
- }
-}