From: ivan Date: Wed, 12 Jul 2006 23:33:56 +0000 (+0000) Subject: add acl bootstrapping - should be installable again now X-Git-Tag: BEFORE_FINAL_MASONIZE~85 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=e5742a8ccfca16427631a45fc8895d6fc1a493dd add acl bootstrapping - should be installable again now --- diff --git a/FS/FS/Setup.pm b/FS/FS/Setup.pm index 8e89be5eb..c53fe65b4 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); diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index 9f87f10b7..138011430 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -7,6 +7,7 @@ use strict; use vars qw($opt_s $opt_d $opt_v); use Getopt::Std; use FS::UID qw(adminsuidsetup datasrc checkeuid getsecrets); +use FS::CurrentUser; use FS::Schema qw( dbdef_dist reload_dbdef ); use FS::Record; #use FS::raddb; @@ -85,6 +86,7 @@ $dbdef->save($dbdef_file); # create 'em ### +$FS::CurrentUser::upgrade_hack = 1; my $dbh = adminsuidsetup $user; #create tables