[freeside-commits] branch FREESIDE_3_BRANCH updated. a023312fbe3f64d119852581a295945b11ef4575

Ivan ivan at 420.am
Wed Apr 26 18:21:08 PDT 2017


The branch, FREESIDE_3_BRANCH has been updated
       via  a023312fbe3f64d119852581a295945b11ef4575 (commit)
      from  7a1434e52b4c726ccb691026e2bf8240fae5b6f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a023312fbe3f64d119852581a295945b11ef4575
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Apr 26 18:21:06 2017 -0700

    add a separate ACL for churn report, RT#75012

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 1881b52..4bf45a6 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -299,6 +299,7 @@ tie my %rights, 'Tie::IxHash',
     { rightname=>'View system logs' },
 
     'Download report data',
+    'Customers: Customer churn report',
     'Services: Accounts',
     'Services: Accounts: Advanced search',
     'Services: Domains',
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index 8ff5505..ba2dd9c 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -254,6 +254,7 @@ sub _upgrade_data { # class method
     '_ALL' => 'Employee preference telephony integration',
     'Add on-the-fly credit reason' => 'Add on-the-fly refund reason',
     'Resend invoices' => 'Print and mail invoices',
+    'List customers' => 'Customers: Customer churn report',
   );
 
 #  foreach my $old_acl ( keys %onetime ) {
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 829a787..07dc699 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -133,9 +133,12 @@ $report_customers_lists{'with USPS-unvalidated addresses'} = [ $fsurl. 'search/c
 tie my %report_customers, 'Tie::IxHash';
 $report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ]
   if $curuser->access_right('List all customers');
-$report_customers{'Zip code distribution'}     = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ];
-$report_customers{'Customer signup report'}    = [ $fsurl. 'graph/report_cust_signup.html',    'New customer signups by date' ];
-$report_customers{'Customer churn report'} =  [ $fsurl.'graph/report_cust_churn.html', 'New customers, suspensions, and cancellations summary' ];
+$report_customers{'Zip code distribution'}     = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ]
+  if $curuser->access_right('List zip codes');
+$report_customers{'Customer signup report'}    = [ $fsurl. 'graph/report_cust_signup.html',    'New customer signups by date' ]
+  if $curuser->access_right('Financial reports');
+$report_customers{'Customer churn report'} =  [ $fsurl.'graph/report_cust_churn.html', 'New customers, suspensions, and cancellations summary' ]
+  if $curuser->access_right('Customers: Customer churn report');
 $report_customers{'Signup date report'}        = [ $fsurl. 'graph/report_signupdate.html',     'Signup date report (by date of signup)' ];
 $report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html',     'by status, signup date, agent, etc.' ]
   if $curuser->access_right('Advanced customer search');
@@ -436,7 +439,11 @@ $report_menu{'Quotations'}     = [ \%report_quotations, 'Quotation reports' ]
   if $curuser->access_right('List quotations');
 $report_menu{'Customers'}      = [ \%report_customers, 'Customer reports'  ]
   if $curuser->access_right('List customers')
-  || $curuser->access_right('List contacts');
+  || $curuser->access_right('List contacts')
+  || $curuser->access_right('Advanced customer search')
+  || $curuser->access_right('List zip codes')
+  || $curuser->access_right('Financial reports')
+  || $curuser->access_right('Customers: Customer churn report');
 $report_menu{'Invoices'}       =  [ \%report_invoices,  'Invoice reports'   ]
   if $curuser->access_right('List invoices');
 $report_menu{'Discounts'}      =  [ \%report_discounts, 'Discount reports'  ]
diff --git a/httemplate/graph/cust_churn.html b/httemplate/graph/cust_churn.html
index 07193c7..1777b05 100644
--- a/httemplate/graph/cust_churn.html
+++ b/httemplate/graph/cust_churn.html
@@ -18,7 +18,7 @@
 
 my $curuser = $FS::CurrentUser::CurrentUser;
 die "access denied"
-  unless $curuser->access_right('List customers');
+  unless $curuser->access_right('Customers: Customer churn report');
 
 my( $agentnum, $agent ) = ('', '');
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
diff --git a/httemplate/graph/report_cust_churn.html b/httemplate/graph/report_cust_churn.html
index 3f94277..7065544 100644
--- a/httemplate/graph/report_cust_churn.html
+++ b/httemplate/graph/report_cust_churn.html
@@ -27,6 +27,6 @@
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('List customers');
+  unless $FS::CurrentUser::CurrentUser->access_right('Customers: Customer churn report');
 
 </%init>

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/AccessRight.pm                    |    1 +
 FS/FS/access_right.pm                   |    1 +
 httemplate/elements/menu.html           |   15 +++++++++++----
 httemplate/graph/cust_churn.html        |    2 +-
 httemplate/graph/report_cust_churn.html |    2 +-
 5 files changed, 15 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list