[freeside-commits] branch master updated. eb1652e3e27879dc21fb5de882581b5759a66bee

Ivan ivan at 420.am
Wed Apr 4 15:50:22 PDT 2012


The branch, master has been updated
       via  eb1652e3e27879dc21fb5de882581b5759a66bee (commit)
       via  3de7385d0a6ad25fa300f50929473f33998ea858 (commit)
       via  af42c70c94eb8fbb363238fba056d98ee2204b8f (commit)
       via  f84937b2a6cc6ba63cdab177866b1417c32b1028 (commit)
       via  59db9d8aa66fe128a26e512c5172982e041c59ae (commit)
      from  583e90e3de4d707996084dc82b794f26063b7fea (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 eb1652e3e27879dc21fb5de882581b5759a66bee
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Apr 4 15:50:21 2012 -0700

    add "Summarize packages" ACL, RT#16534

diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index d2a39aa..341055b 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -182,23 +182,30 @@ sub _upgrade_data { # class method
 
   my @all_groups = qsearch('access_group', {});
 
-  ### ACL_list_all_customers
-  if ( !FS::upgrade_journal->is_done('ACL_list_all_customers') ) {
+  my %onetime = (
+    'List customers' => 'List all customers',
+    'List packages'  => 'Summarize packages',
+  );
+
+  foreach my $old_acl ( keys %onetime ) {
+    my $new_acl = $onetime{$old_acl}; #support arrayref too?
+    ( my $journal = 'ACL_'.lc($new_acl) ) =~ s/ /_/g;
+    next if FS::upgrade_journal->is_done($journal);
 
-    # grant "List all customers" to all users who have "List customers"
+    # grant $new_acl to all groups who have $old_acl
     for my $group (@all_groups) {
-      if ( $group->access_right('List customers') ) {
+      if ( $group->access_right($old_acl) ) {
         my $access_right = FS::access_right->new( {
             'righttype'   => 'FS::access_group',
             'rightobjnum' => $group->groupnum,
-            'rightname'   => 'List all customers',
+            'rightname'   => $new_acl,
         } );
         my $error = $access_right->insert;
         die $error if $error;
       }
     }
     
-    FS::upgrade_journal->set_done('ACL_list_all_customers');
+    FS::upgrade_journal->set_done($journal);
   }
 
   ### ACL_download_report_data

commit 3de7385d0a6ad25fa300f50929473f33998ea858
Merge: af42c70 583e90e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Apr 4 15:41:23 2012 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit af42c70c94eb8fbb363238fba056d98ee2204b8f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Apr 4 15:31:13 2012 -0700

    add "Summarize packages" ACL, RT#16534

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 1bfae03..06263c2 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -256,6 +256,7 @@ tie my %rights, 'Tie::IxHash',
     'List zip codes', #NEW
     'List invoices',
     'List packages',
+    'Summarize packages',
     'List services',
     'List service passwords',
   
@@ -361,6 +362,7 @@ sub default_superuser_rights {
     'Delete payment',
     'Delete credit', #?
     'Delete refund', #?
+    'Edit customer package dates',
     'Time queue',
     'Redownload resolved batches',
     'Raw SQL',
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 3b0969f..24e4390 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -238,9 +238,11 @@ if ( $curuser->access_right('Financial reports') ) {
   $report_packages{'separator2'} =  '';
 }
 $report_packages{'All customer packages'} =  [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ];
-$report_packages{'Package summary'} = [ $fsurl.'search/cust_pkg_summary.html', 'Show package sales summary', ];
+$report_packages{'Package summary'} = [ $fsurl.'search/cust_pkg_summary.html', 'Show package sales summary', ]
+  if $curuser->access_right('Summarize packages');
 $report_packages{'Suspended customer packages'} =  [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ];
-$report_packages{'Suspension summary'} = [ $fsurl.'search/cust_pkg_susp.html', 'Show suspension activity', ];
+$report_packages{'Suspension summary'} = [ $fsurl.'search/cust_pkg_susp.html', 'Show suspension activity', ]
+  if $curuser->access_right('Summarize packages');
 $report_packages{'Customer packages with unconfigured services'} =  [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ];
 $report_packages{'FCC Form 477 packages'} =  [ $fsurl.'search/report_477.html', 'Summarize packages by census tract for particular types' ]
   if $conf->exists('cust_main-require_censustract');
diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi
index cea4cdc..fbeeb92 100644
--- a/httemplate/search/cust_pkg_summary.cgi
+++ b/httemplate/search/cust_pkg_summary.cgi
@@ -25,7 +25,7 @@
 my $curuser = $FS::CurrentUser::CurrentUser;
 
 die "access denied"
-  unless $curuser->access_right('List packages');
+  unless $curuser->access_right('Summarize packages');
 
 my $title = 'Package Summary Report';
 my ($begin, $end) = FS::UI::Web::parse_beginning_ending($cgi);
diff --git a/httemplate/search/cust_pkg_summary.html b/httemplate/search/cust_pkg_summary.html
index a0ef472..f9adf04 100644
--- a/httemplate/search/cust_pkg_summary.html
+++ b/httemplate/search/cust_pkg_summary.html
@@ -21,4 +21,8 @@
 
 <% include('/elements/footer.html') %>
 <%init>
+
+die "access denied"
+  unless $curuser->access_right('Summarize packages');
+
 </%init>
diff --git a/httemplate/search/cust_pkg_susp.cgi b/httemplate/search/cust_pkg_susp.cgi
index 9ab5992..d6bbc43 100644
--- a/httemplate/search/cust_pkg_susp.cgi
+++ b/httemplate/search/cust_pkg_susp.cgi
@@ -25,7 +25,7 @@
 my $curuser = $FS::CurrentUser::CurrentUser;
 
 die "access denied"
-  unless $curuser->access_right('List packages');
+  unless $curuser->access_right('Summarize packages');
 
 my $money_char = FS::Conf->new()->config('money_char') || '$';
 
diff --git a/httemplate/search/cust_pkg_susp.html b/httemplate/search/cust_pkg_susp.html
index c59e6c1..2ac6432 100644
--- a/httemplate/search/cust_pkg_susp.html
+++ b/httemplate/search/cust_pkg_susp.html
@@ -21,4 +21,8 @@
 
 <% include('/elements/footer.html') %>
 <%init>
+
+die "access denied"
+  unless $curuser->access_right('Summarize packages');
+
 </%init>

commit f84937b2a6cc6ba63cdab177866b1417c32b1028
Merge: 59db9d8 c2ee6c5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 2 10:37:52 2012 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 59db9d8aa66fe128a26e512c5172982e041c59ae
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Apr 1 11:07:12 2012 -0700

    3.0

diff --git a/httemplate/docs/about.html b/httemplate/docs/about.html
index f0994e5..76a477c 100644
--- a/httemplate/docs/about.html
+++ b/httemplate/docs/about.html
@@ -8,7 +8,7 @@
 </CENTER>
 
 <CENTER>
-<FONT SIZE="-1">© 2011 Freeside Internet Services, Inc.<BR>
+<FONT SIZE="-1">© 2012 Freeside Internet Services, Inc.<BR>
 All rights reserved.<BR>
 Licensed under the terms of the<BR>
 GNU <b>Affero</b> General Public License.<BR>
@@ -29,7 +29,7 @@ GNU <b>Affero</b> General Public License.<BR>
 <BR>
 
 <CENTER>
-<FONT SIZE="-3">"The sky was yellow and the sun was blue" -R. Hunter</FONT>
+<FONT SIZE="-3">"A selfish heart is trouble, but a foolish heart is worse" -R. Hunter</FONT>
 </CENTER>
 
 <SCRIPT TYPE="text/javascript">

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

Summary of changes:
 FS/FS/AccessRight.pm                    |    2 ++
 FS/FS/access_right.pm                   |   19 +++++++++++++------
 httemplate/docs/about.html              |    4 ++--
 httemplate/elements/menu.html           |    6 ++++--
 httemplate/search/cust_pkg_summary.cgi  |    2 +-
 httemplate/search/cust_pkg_summary.html |    4 ++++
 httemplate/search/cust_pkg_susp.cgi     |    2 +-
 httemplate/search/cust_pkg_susp.html    |    4 ++++
 8 files changed, 31 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list