logic bug in new perm checker. removed some dead code
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Feb 2008 18:03:15 +0000 (18:03 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Feb 2008 18:03:15 +0000 (18:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8669 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm

index df3bfc4..88f6e09 100644 (file)
@@ -397,7 +397,8 @@ sub allowed {
        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 @@ sub allowed {
 }
 
 
-=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
 # -----------------------------------------------------------------------------