[open-ils-commits] r8669 - trunk/Open-ILS/src/perlmods/OpenILS/Utils

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Feb 6 13:31:44 EST 2008


Author: erickson
Date: 2008-02-06 13:03:15 -0500 (Wed, 06 Feb 2008)
New Revision: 8669

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
Log:
logic bug in new perm checker.  removed some dead code

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm	2008-02-06 17:54:28 UTC (rev 8668)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm	2008-02-06 18:03:15 UTC (rev 8669)
@@ -397,7 +397,8 @@
 	my $uid = $self->requestor->id;
 	$org ||= $self->requestor->ws_ou;
 
-    my $perms = [$perm] unless ref($perm) eq 'ARRAY';
+    my $perms = (ref($perm) eq 'ARRAY') ? $perm : [$perm];
+
     for $perm (@$perms) {
 	    $self->log(I, "checking perms user=$uid, org=$org, perm=$perm");
     
@@ -415,24 +416,6 @@
 }
 
 
-=head
-sub checkperm {
-	my($self, $userid, $org, $perm) = @_;
-	my $s = $U->storagereq(
-		"open-ils.storage.permission.user_has_perm", $userid, $perm, $org );
-
-	if(!$s) {
-		my $e = OpenILS::Event->new('PERM_FAILURE', ilsperm => $perm, ilspermloc => $org);
-		$self->event($e);
-		return undef;
-	}
-
-	return 1;
-}
-=cut
-
-
-
 # -----------------------------------------------------------------------------
 # checks the appropriate perm for the operation
 # -----------------------------------------------------------------------------



More information about the open-ils-commits mailing list