summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--httemplate/browse/addr_block.cgi10
-rw-r--r--httemplate/browse/router.cgi8
-rwxr-xr-xhttemplate/browse/svc_acct_pop.cgi4
-rw-r--r--httemplate/edit/allocate.html8
-rwxr-xr-xhttemplate/edit/process/addr_block/add.cgi6
-rwxr-xr-xhttemplate/edit/process/addr_block/allocate.cgi4
-rwxr-xr-xhttemplate/edit/process/addr_block/deallocate.cgi6
-rwxr-xr-xhttemplate/edit/process/addr_block/split.cgi6
-rw-r--r--httemplate/edit/process/router.cgi6
-rwxr-xr-xhttemplate/edit/process/svc_acct_pop.cgi4
-rwxr-xr-xhttemplate/edit/router.cgi4
-rwxr-xr-xhttemplate/edit/svc_acct_pop.cgi4
-rw-r--r--httemplate/elements/menu.html9
17 files changed, 84 insertions, 44 deletions
diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 262b134d1..db2a31f4d 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 cf9730d7e..4f8d1e9a0 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 5815f1abd..9d523e1fc 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 bfc553087..7a9fda398 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;
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi
index 917f94c96..945f8da01 100644
--- a/httemplate/browse/addr_block.cgi
+++ b/httemplate/browse/addr_block.cgi
@@ -43,15 +43,15 @@
'border-left:none;',
],
'agent_virt' => 1,
- 'agent_null_right' => 'Engineering global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
'agent_pos' => 1,
)
%>
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Engineering configuration')
- || $FS::CurrentUser::CurrentUser->access_right('Engineering global configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Broadband configuration')
+ || $FS::CurrentUser::CurrentUser->access_right('Broadband global configuration');
my $p2 = popurl(2);
my $path = $p2 . "edit/process/addr_block";
@@ -59,7 +59,7 @@ my $path = $p2 . "edit/process/addr_block";
my $extra_sql = "";
my $count_sql = "WHERE ". $FS::CurrentUser::CurrentUser->agentnums_sql(
- 'null_right' => 'Engineering global configuration',
+ 'null_right' => 'Broadband global configuration',
);
my $order_by = "ORDER BY ";
@@ -90,7 +90,7 @@ my $html_foot = qq(
);
$html_foot .= include( '/elements/select-agent.html',
'agent_virt' => 1,
- 'agent_null_right' => 'Engineering global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
);
$html_foot .= qq(
<INPUT TYPE="submit" NAME="submit" VALUE="Add">
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi
index 9f7167329..541e967dd 100644
--- a/httemplate/browse/router.cgi
+++ b/httemplate/browse/router.cgi
@@ -20,15 +20,15 @@
'',
],
'agent_virt' => 1,
- 'agent_null_right'=> "Engineering global configuration",
+ 'agent_null_right'=> "Broadband global configuration",
'agent_pos' => 1,
)
%>
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Engineering configuration')
- || $FS::CurrentUser::CurrentUser->access_right('Engineering global configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Broadband configuration')
+ || $FS::CurrentUser::CurrentUser->access_right('Broadband global configuration');
my $p2 = popurl(2);
my $extra_sql = '';
@@ -46,7 +46,7 @@ if ($cgi->param('hidecustomerrouters') eq '1') {
my $count_sql = $extra_sql. ( $extra_sql =~ /WHERE/ ? ' AND' : 'WHERE' ).
$FS::CurrentUser::CurrentUser->agentnums_sql(
- 'null_right' => 'Engineering global configuration',
+ 'null_right' => 'Broadband global configuration',
);
</%init>
diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi
index 4e493717a..c6e615d40 100755
--- a/httemplate/browse/svc_acct_pop.cgi
+++ b/httemplate/browse/svc_acct_pop.cgi
@@ -30,8 +30,8 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Dialup configuration')
+ || $curuser->access_right('Dialup global configuration');
my $html_init = qq!
<A HREF="${p}edit/svc_acct_pop.cgi"><I>Add new Access Number</I></A>
diff --git a/httemplate/edit/allocate.html b/httemplate/edit/allocate.html
index 0f05fcc7d..8d1347df2 100644
--- a/httemplate/edit/allocate.html
+++ b/httemplate/edit/allocate.html
@@ -14,20 +14,20 @@
'disable_empty' => 1,
'agent_virt' => 1,
'agent_null_right' =>
- 'Engineering global configuration',
+ 'Broadband global configuration',
},
],
'post_url' => "process/addr_block/allocate.cgi",
'popup' => 1,
'agent_virt' => 1,
- 'agent_null_right' => 'Engineering global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
)
%>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
</%init>
diff --git a/httemplate/edit/process/addr_block/add.cgi b/httemplate/edit/process/addr_block/add.cgi
index 4321f946a..39d6348ce 100755
--- a/httemplate/edit/process/addr_block/add.cgi
+++ b/httemplate/edit/process/addr_block/add.cgi
@@ -3,7 +3,7 @@
'redirect' => popurl(4). 'browse/addr_block.cgi?dummy=',
'error_redirect' => popurl(4). 'browse/addr_block.cgi?',
'agent_virt' => 1,
- 'agent_null_right' => 'Engineering global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
)
%>
@@ -11,8 +11,8 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
$cgi->param('routernum', 0) # in FS::addr_block::check instead?
unless $cgi->param('routernum');
diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi
index f377d8155..40d04b369 100755
--- a/httemplate/edit/process/addr_block/allocate.cgi
+++ b/httemplate/edit/process/addr_block/allocate.cgi
@@ -10,7 +10,7 @@
my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
</%init>
diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi
index 91184b33e..128824ec7 100755
--- a/httemplate/edit/process/addr_block/deallocate.cgi
+++ b/httemplate/edit/process/addr_block/deallocate.cgi
@@ -5,7 +5,7 @@
'redirect' => popurl(4). 'browse/addr_block.cgi?',
'error_redirect' => popurl(4). 'browse/addr_block.cgi?',
'agent_virt' => 1,
- 'agent_null_right' => 'Engineering global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
)
%>
<%init>
@@ -13,8 +13,8 @@
my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
$cgi->param('routernum', 0); # just to be explicit about what we are doing
</%init>
diff --git a/httemplate/edit/process/addr_block/split.cgi b/httemplate/edit/process/addr_block/split.cgi
index eb55d008e..045fd30de 100755
--- a/httemplate/edit/process/addr_block/split.cgi
+++ b/httemplate/edit/process/addr_block/split.cgi
@@ -4,8 +4,8 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
my $error = '';
$cgi->param('blocknum') =~ /^(\d+)$/ or die "invalid blocknum";
@@ -14,7 +14,7 @@ my $blocknum = $1;
my $addr_block = qsearchs({ 'table' => 'addr_block',
'hashref' => { blocknum => $blocknum },
'extra_sql' => ' AND '. $curuser->agentnums_sql(
- 'null_right' => 'Engineering global configuration'
+ 'null_right' => 'Broadband global configuration'
),
})
or $error = "Unknown blocknum: $blocknum";
diff --git a/httemplate/edit/process/router.cgi b/httemplate/edit/process/router.cgi
index 6e717d19c..3cbb8c58e 100644
--- a/httemplate/edit/process/router.cgi
+++ b/httemplate/edit/process/router.cgi
@@ -7,14 +7,14 @@
'target_table' => 'part_svc',
},
'agent_virt' => 1,
- 'agent_null_right' => 'Engineering global configuration',
+ 'agent_null_right' => 'Broadband global configuration',
)
%>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
</%init>
diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi
index 522e94948..6e823a824 100755
--- a/httemplate/edit/process/svc_acct_pop.cgi
+++ b/httemplate/edit/process/svc_acct_pop.cgi
@@ -9,8 +9,8 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Dialup configuration')
+ || $curuser->access_right('Dialup global configuration');
my $popnum = $cgi->param('popnum');
diff --git a/httemplate/edit/router.cgi b/httemplate/edit/router.cgi
index 180dcb7a7..19e63b3e8 100755
--- a/httemplate/edit/router.cgi
+++ b/httemplate/edit/router.cgi
@@ -21,8 +21,8 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
my $callback = sub {
my ($cgi, $object, $fields) = (shift, shift, shift);
diff --git a/httemplate/edit/svc_acct_pop.cgi b/httemplate/edit/svc_acct_pop.cgi
index b0ae1c381..5930a38be 100755
--- a/httemplate/edit/svc_acct_pop.cgi
+++ b/httemplate/edit/svc_acct_pop.cgi
@@ -30,8 +30,8 @@ Local <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="<% $hashref->{
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Engineering configuration')
- || $curuser->access_right('Engineering global configuration');
+ unless $curuser->access_right('Dialup configuration')
+ || $curuser->access_right('Dialup global configuration');
my $svc_acct_pop;
if ( $cgi->param('error') ) {
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index d476e3098..60ea8b22b 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -335,11 +335,10 @@ $config_menu{'Resellers'} = [ \%config_agent, '' ]
$config_menu{'Billing'} = [ \%config_billing, '' ]
if $curuser->access_right('Edit billing events')
|| $curuser->access_right('Edit global billing events');
-if ( $curuser->access_right('Engineering configuration') ) {
- $config_menu{'Dialup'} = [ \%config_dialup, '' ];
- $config_menu{'Fixed (username-less) broadband'} =
- [ \%config_broadband, '' ];
-}
+$config_menu{'Dialup'} = [ \%config_dialup, '' ]
+ if ( $curuser->access_right('Dialup configuration') );
+$config_menu{'Fixed (username-less) broadband'} = [ \%config_broadband, '' ]
+ if ( $curuser->access_right('Broadband configuration') );
$config_menu{'Miscellaneous'} = [ \%config_misc, '' ]
if $curuser->access_right('Edit advertising sources')
|| $curuser->access_right('Edit global advertising sources');