summaryrefslogtreecommitdiff
path: root/FS/FS/Setup.pm
diff options
context:
space:
mode:
authorivan <ivan>2006-07-12 23:33:56 +0000
committerivan <ivan>2006-07-12 23:33:56 +0000
commite5742a8ccfca16427631a45fc8895d6fc1a493dd (patch)
tree5103a8107352d23cc1dfdc979af669d69582fdc1 /FS/FS/Setup.pm
parent1053db7f76169cbbc87840539959a4c362aff242 (diff)
add acl bootstrapping - should be installable again now
Diffstat (limited to 'FS/FS/Setup.pm')
-rw-r--r--FS/FS/Setup.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/FS/FS/Setup.pm b/FS/FS/Setup.pm
index 8e89be5..c53fe65 100644
--- a/FS/FS/Setup.pm
+++ b/FS/FS/Setup.pm
@@ -48,6 +48,8 @@ sub create_initial_data {
#initial_data data
populate_initial_data(%opt);
+ populate_access();
+
populate_msgcat();
if ( $oldAutoCommit ) {
@@ -131,6 +133,11 @@ sub initial_data {
#tie my %hash, 'Tie::DxHash',
tie my %hash, 'Tie::IxHash',
+ #superuser group
+ 'access_group' => [
+ { 'groupname' => 'Superuser' },
+ ],
+
#billing events
'part_bill_event' => [
{ 'payby' => 'CARD',
@@ -282,6 +289,32 @@ sub initial_data {
}
+sub populate_access {
+
+ use FS::AccessRight;
+ use FS::access_right;
+
+ foreach my $rightname ( FS::AccessRight->rights ) {
+ my $access_right = new FS::access_right {
+ 'righttype' => 'FS::access_group',
+ 'rightobjnum' => 1, #$supergroup->groupnum,
+ 'rightname' => $rightname,
+ };
+ my $ar_error = $access_right->insert;
+ die $ar_error if $ar_error;
+ }
+
+ #foreach my $agent ( qsearch('agent', {} ) ) {
+ my $access_groupagent = new FS::access_groupagent {
+ 'groupnum' => $supergroup->groupnum,
+ 'agentnum' => 1, #$agent->agentnum,
+ };
+ my $aga_error = $access_groupagent->insert;
+ die $aga_error if $aga_error;
+ #}
+
+}
+
sub populate_msgcat {
use FS::Record qw(qsearch);