summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorjeff <jeff>2008-09-03 19:08:29 +0000
committerjeff <jeff>2008-09-03 19:08:29 +0000
commit3e2c08dba947ea254c60cbd621776c0f5dddb2e8 (patch)
treeaf0f7a0dfeacbefe351964d3e97c66c04eca58ec /FS/FS
parent1ce2d49c8b5af031066e8dbf4837cf220eb03269 (diff)
new access right names
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/AccessRight.pm7
-rw-r--r--FS/FS/access_right.pm38
-rwxr-xr-xFS/FS/addr_block.pm2
-rwxr-xr-xFS/FS/router.pm2
4 files changed, 45 insertions, 4 deletions
diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 262b134..db2a31f 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -240,8 +240,11 @@ tie my %rights, 'Tie::IxHash',
'Edit billing events',
{ rightname=>'Edit global billing events', global=>1 },
- { rightname=>'Engineering configuration' },
- { rightname=>'Engineering global configuration', global=>1 },
+ { rightname=>'Dialup configuration' },
+ { rightname=>'Dialup global configuration', global=>1 },
+
+ { rightname=>'Broadband configuration' },
+ { rightname=>'Broadband global configuration', global=>1 },
{ rightname=>'Configuration', global=>1 }, #most of the rest of the configuraiton is not agent-virtualized
],
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index cf9730d..4f8d1e9 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -111,6 +111,44 @@ sub check {
$self->SUPER::check;
}
+# _upgrade_data
+#
+# Used by FS::Upgrade to migrate to a new database.
+
+sub _upgrade_data { # class method
+ my ($class, %opts) = @_;
+
+ my @unmigrated = ( qsearch( 'access_right',
+ { 'righttype'=>'FS::access_group',
+ 'rightname'=>'Engineering configuration',
+ }
+ ),
+ qsearch( 'access_right',
+ { 'righttype'=>'FS::access_group',
+ 'rightname'=>'Engineering global configuration',
+ }
+ )
+ );
+ foreach ( @unmigrated ) {
+ my $rightname = $_->rightname;
+ $rightname =~ s/Engineering/Dialup/;
+ $_->rightname($rightname);
+ my $error = $_->replace;
+ die "Failed to update access right: $error"
+ if $error;
+ my $broadband = new FS::access_right { $_->hash };
+ $rightname =~ s/Dialup/Broadband/;
+ $broadband->rightnum('');
+ $broadband->rightname($rightname);
+ $error = $broadband->insert;
+ die "Failed to insert access right: $error"
+ if $error;
+ }
+
+ '';
+
+}
+
=back
=head1 BUGS
diff --git a/FS/FS/addr_block.pm b/FS/FS/addr_block.pm
index 5815f1a..9d523e1 100755
--- a/FS/FS/addr_block.pm
+++ b/FS/FS/addr_block.pm
@@ -124,7 +124,7 @@ sub check {
$self->ut_number('routernum')
|| $self->ut_ip('ip_gateway')
|| $self->ut_number('ip_netmask')
- || $self->ut_agentnum_acl('agentnum', 'Engineering global configuration')
+ || $self->ut_agentnum_acl('agentnum', 'Broadband global configuration')
;
return $error if $error;
diff --git a/FS/FS/router.pm b/FS/FS/router.pm
index bfc5530..7a9fda3 100755
--- a/FS/FS/router.pm
+++ b/FS/FS/router.pm
@@ -83,7 +83,7 @@ sub check {
my $error =
$self->ut_numbern('routernum')
|| $self->ut_text('routername')
- || $self->ut_agentnum_acl('agentnum', 'Engineering global configuration')
+ || $self->ut_agentnum_acl('agentnum', 'Broadband global configuration')
;
return $error if $error;