blob: 16ea71b2d96d0cce17a1afd2d9ccfa3c1077cf08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
sub acl {
my $dbh = shift;
my @acls;
my @tables = qw (
attachments_id_seq
Attachments
queues_id_seq
Queues
links_id_seq
Links
principals_id_seq
Principals
groups_id_seq
Groups
scripconditions_id_seq
ScripConditions
transactions_id_seq
Transactions
scrips_id_seq
Scrips
acl_id_seq
ACL
groupmembers_id_seq
GroupMembers
cachedgroupmembers_id_seq
CachedGroupMembers
users_id_seq
Users
tickets_id_seq
Tickets
scripactions_id_seq
ScripActions
templates_id_seq
Templates
ticketcustomfieldvalues_id_s
TicketCustomFieldValues
customfields_id_seq
CustomFields
customfieldvalues_id_seq
CustomFieldValues
sessions
);
# if there's already an rt_user, drop it.
my @row =
$dbh->selectrow_array( "select usename from pg_user where usename = '" . $RT::DatabaseUser."'" );
if ( $row[0] ) {
push @acls, "drop user ${RT::DatabaseUser};",;
}
push @acls, "create user ${RT::DatabaseUser} with password '${RT::DatabasePassword}' NOCREATEDB NOCREATEUSER;";
foreach my $table (@tables) {
push @acls,
"GRANT SELECT, INSERT, UPDATE, DELETE ON $table to "
. $RT::DatabaseUser . ";";
}
return (@acls);
}
1;
|