[freeside-commits] freeside/FS/FS AccessRight.pm, 1.55, 1.56 access_right.pm, 1.4, 1.5
Ivan,,,
ivan at wavetail.420.am
Wed Nov 3 16:44:49 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv32653/FS/FS
Modified Files:
AccessRight.pm access_right.pm
Log Message:
more granular ACLs for posting check vs. cash payments, processing credit card vs echecks, RT#7887
Index: AccessRight.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/AccessRight.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -w -d -r1.55 -r1.56
--- AccessRight.pm 20 Oct 2010 02:07:01 -0000 1.55
+++ AccessRight.pm 3 Nov 2010 23:44:47 -0000 1.56
@@ -183,15 +183,16 @@
# customer payment rights
###
'Customer payment rights' => [
- 'Post payment',
+ { rightname=>'Post payment', desc=>'Make check or cash payments.' },
+ 'Post check payment',
+ 'Post cash payment',
'Post payment batch',
'Apply payment', #NEWNEW
{ rightname=>'Unapply payment', desc=>'Enable "unapplication" of unclosed payments from specific invoices.' }, #aka. unapplypayments
- 'Process payment',
- { rightname=>'Refund payment', desc=>'Enable refund of existing customer payments.' },
-
+ { rightname=>'Process payment', desc=>'Process credit card or e-check payments' },
+ 'Process credit card payment',
+ 'Process Echeck payment',
{ rightname=>'Delete payment', desc=>'Enable deletion of unclosed payments. Be very careful! Only delete payments that were data-entry errors, not adjustments.' }, #aka. deletepayments Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.
-
],
###
@@ -203,7 +204,12 @@
{ rightname=>'Unapply credit', desc=>'Enable "unapplication" of unclosed credits.' }, #aka unapplycredits
{ rightname=>'Delete credit', desc=>'Enable deletion of unclosed credits. Be very careful! Only delete credits that were data-entry errors, not adjustments.' }, #aka. deletecredits Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.
{ rightname=>'Post refund', desc=>'Enable posting of check and cash refunds.' },
+ 'Post check refund',
+ 'Post cash refund',
# { rightname=>'Process refund', desc=>'Enable processing of generic credit card/ACH refunds (i.e. not associated with a specific prior payment).' },
+ { rightname=>'Refund payment', desc=>'Enable refund of existing customer credit card or e-check payments.' },
+ 'Refund credit card payment',
+ 'Refund Echeck payment',
'Delete refund', #NEW
'Add on-the-fly credit reason', #NEW
],
@@ -348,6 +354,7 @@
'Raw SQL',
'Configuration download',
'View customers of all agents',
+ 'View/link unlinked services',
);
no warnings 'uninitialized';
Index: access_right.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/access_right.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- access_right.pm 11 Oct 2009 01:40:06 -0000 1.4
+++ access_right.pm 3 Nov 2010 23:44:47 -0000 1.5
@@ -145,6 +145,41 @@
if $error;
}
+ my %migrate = (
+ 'Post payment' => [ 'Post check payment', 'Post cash payment' ],
+ 'Process payment' => [ 'Process credit card payment', 'Process Echeck payment' ],
+ 'Post refund' => [ 'Post check refund', 'Post cash refund' ],
+ 'Refund payment' => [ 'Refund credit card payment', 'Refund Echeck payment' ],
+ );
+
+ foreach my $oldright (keys %migrate) {
+ my @old = qsearch('access_right', { 'righttype'=>'FS::access_group',
+ 'rightname'=>$oldright,
+ }
+ );
+
+ foreach my $old ( @old ) {
+
+ foreach my $newright ( @{ $migrate{$oldright} } ) {
+ my %hash = (
+ 'righttype' => 'FS::access_group',
+ 'rightobjnum' => $old->rightobjnum,
+ 'rightname' => $newright,
+ );
+ next if qsearchs('access_right', \%hash);
+ my $access_right = new FS::access_right \%hash;
+ my $error = $access_right->insert;
+ die $error if $error;
+ }
+
+ #after the WEST stuff is sorted, etc.
+ #my $error = $old->delete;
+ #die $error if $error;
+
+ }
+
+ }
+
'';
}
More information about the freeside-commits
mailing list