Initial commit 4.0.5-3
[usit-rt.git] / etc / acl.mysql
CommitLineData
84fb5b46
MKG
1
2sub acl {
3 my $db_name = RT->Config->Get('DatabaseName');
4 my $db_rthost = RT->Config->Get('DatabaseRTHost');
5 my $db_user = RT->Config->Get('DatabaseUser');
6 my $db_pass = RT->Config->Get('DatabasePassword');
7 unless ( $db_user ) {
8 print STDERR "DatabaseUser option is not defined or empty. Skipping...\n";
9 return;
10 }
11 if ( $db_user eq 'root' ) {
12 print STDERR "DatabaseUser is root. Skipping...\n";
13 return;
14 }
15 print "Granting access to $db_user\@'$db_rthost' on $db_name.\n";
16 $db_name =~ s/([_%])/\\$1/g;
17 return (
18 "GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE
19 ON `$db_name`.*
20 TO '$db_user'\@'$db_rthost'
21 IDENTIFIED BY '$db_pass';",
22 );
23}
24
251;