summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2020-11-09 13:36:44 -0800
committerIvan Kohler <ivan@freeside.biz>2020-11-09 13:36:44 -0800
commita0cca72a0fd0fdd541f39946ce06df59a96a068e (patch)
treeac194c85cb3788210c8895a90c62530c1c207688
parent4a4722fbb99c7db7f68fd4a1078ae67358f5d2cb (diff)
ACL for hardware class config, RT#85057
-rw-r--r--FS/FS/AccessRight.pm2
-rw-r--r--FS/FS/access_right.pm1
-rw-r--r--httemplate/browse/hardware_class.html2
-rw-r--r--httemplate/browse/hardware_status.html2
-rw-r--r--httemplate/edit/hardware_class.html2
-rw-r--r--httemplate/edit/hardware_status.html2
-rw-r--r--httemplate/edit/process/hardware_class.html2
-rw-r--r--httemplate/edit/process/hardware_status.html2
-rw-r--r--httemplate/edit/process/hardware_type.html2
-rw-r--r--httemplate/elements/menu.html2
10 files changed, 11 insertions, 8 deletions
diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 5aeb185..cd4d8b9 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -416,6 +416,8 @@ tie my %rights, 'Tie::IxHash',
{ rightname=>'Alarm configuration' },
{ rightname=>'Alarm global configuration', global=>1 },
+ { rightname=>'Edit hardware classes and types' },
+
{ rightname=> 'Configure network monitoring', global=>1 },
#{ rightname=>'Edit employees', global=>1, },
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index 87337d5..c1e01f1 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -264,6 +264,7 @@ sub _upgrade_data { # class method
'Edit customer note' => 'Delete customer note',
'Edit customer' => 'Edit customer invoice terms',
'Financial reports' => 'Basic payment and refund reports',
+ 'Configuration' => 'Edit hardware clases and types',
);
# foreach my $old_acl ( keys %onetime ) {
diff --git a/httemplate/browse/hardware_class.html b/httemplate/browse/hardware_class.html
index 0bf314e..6423f4a 100644
--- a/httemplate/browse/hardware_class.html
+++ b/httemplate/browse/hardware_class.html
@@ -22,7 +22,7 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Configuration');
+ unless $curuser->access_right('Edit hardware classes and types');
my $menubar =
[ 'Hardware statuses' => $p.'browse/hardware_status.html',
diff --git a/httemplate/browse/hardware_status.html b/httemplate/browse/hardware_status.html
index 89ae830..64ad5ad 100644
--- a/httemplate/browse/hardware_status.html
+++ b/httemplate/browse/hardware_status.html
@@ -16,7 +16,7 @@
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $curuser->access_right('Configuration');
+ unless $curuser->access_right('Edit hardware classes and types');
my $menubar = [ 'Hardware classes' => $p.'browse/hardware_class.html',
'Add a status' => $p.'edit/hardware_status.html' ];
diff --git a/httemplate/edit/hardware_class.html b/httemplate/edit/hardware_class.html
index 26f487d..8d5412b 100644
--- a/httemplate/edit/hardware_class.html
+++ b/httemplate/edit/hardware_class.html
@@ -11,6 +11,6 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit hardware classes and types');
</%init>
diff --git a/httemplate/edit/hardware_status.html b/httemplate/edit/hardware_status.html
index 23e5b6e..c8cb68c 100644
--- a/httemplate/edit/hardware_status.html
+++ b/httemplate/edit/hardware_status.html
@@ -19,6 +19,6 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit hardware classes and types');
</%init>
diff --git a/httemplate/edit/process/hardware_class.html b/httemplate/edit/process/hardware_class.html
index 64bc72e..54e2af6 100644
--- a/httemplate/edit/process/hardware_class.html
+++ b/httemplate/edit/process/hardware_class.html
@@ -6,6 +6,6 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit hardware classes and types');
</%init>
diff --git a/httemplate/edit/process/hardware_status.html b/httemplate/edit/process/hardware_status.html
index 61f02e2..d790eb5 100644
--- a/httemplate/edit/process/hardware_status.html
+++ b/httemplate/edit/process/hardware_status.html
@@ -6,6 +6,6 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit hardware classes and types');
</%init>
diff --git a/httemplate/edit/process/hardware_type.html b/httemplate/edit/process/hardware_type.html
index 5278701..954e76d 100644
--- a/httemplate/edit/process/hardware_type.html
+++ b/httemplate/edit/process/hardware_type.html
@@ -6,6 +6,6 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit hardware classes and types');
</%init>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 88c8e4c..ba633e5 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -689,7 +689,7 @@ $config_export_svc{'Circuits'} = [ \%config_circuit, '' ]
$config_export_svc{'Fiber'} = [ \%config_fiber, '' ]
if $curuser->access_right('Configuration');
$config_export_svc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ]
- if $curuser->access_right('Configuration');
+ if $curuser->access_right('Edit hardware classes and types');
tie my %config_pkg_reason, 'Tie::IxHash',
'Cancel reasons' => [ $fsurl.'browse/reason_type.html?class=C', 'Cancel reasons explain why a service was cancelled.' ],