add "Edit package definition costs" ACL, RT#27140
authorIvan Kohler <ivan@freeside.biz>
Sat, 15 Feb 2014 22:42:24 +0000 (14:42 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sat, 15 Feb 2014 22:42:24 +0000 (14:42 -0800)
FS/FS/AccessRight.pm
FS/FS/access_right.pm
httemplate/edit/part_pkg.cgi

index 1c24bf5..9de9eac 100644 (file)
@@ -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',
index 7b3ca3f..0906c0c 100644 (file)
@@ -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 ) {
index 2ec3481..cabaf0a 100755 (executable)
                      { 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',