From 1d92f6927bf5dd1b2d48041bba913cab881ff6c9 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 15 Feb 2014 14:42:24 -0800 Subject: [PATCH] add "Edit package definition costs" ACL, RT#27140 --- FS/FS/AccessRight.pm | 3 ++- FS/FS/access_right.pm | 1 + httemplate/edit/part_pkg.cgi | 11 +++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm index 1c24bf568..9de9eac06 100644 --- a/FS/FS/AccessRight.pm +++ b/FS/FS/AccessRight.pm @@ -352,7 +352,8 @@ tie my %rights, 'Tie::IxHash', 'Edit package definitions', { rightname=>'Edit global package definitions', global=>1 }, - + 'Edit package definition costs', + 'Bulk edit package definitions', 'Edit billing events', diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm index 7b3ca3f35..0906c0c9a 100644 --- a/FS/FS/access_right.pm +++ b/FS/FS/access_right.pm @@ -243,6 +243,7 @@ sub _upgrade_data { # class method 'Configuration' => 'Alarm global configuration', 'Services: Accounts' => 'Services: Conferencing', 'Services: Accounts' => 'Services: Video', + 'Edit global package definitions' => 'Edit package definition costs', ); # foreach my $old_acl ( keys %onetime ) { diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 2ec3481e5..cabaf0a05 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -200,8 +200,15 @@ { type => 'tablebreak-tr-title', value => 'Cost tracking', #better name? }, - { field=>'setup_cost', type=>'money', }, - { field=>'recur_cost', type=>'money', }, + + ( $curuser->access_right('Edit package definition costs') + ? ( { field=>'setup_cost', type=>'money', }, + { field=>'recur_cost', type=>'money', }, + ) + : ( { field=>'setup_cost', type=>'fixed', }, + { field=>'recur_cost', type=>'fixed', }, + ) + ), ( $conf->exists('part_pkg-delay_start') ? ( { type => 'tablebreak-tr-title', -- 2.11.0