From abfa47343e5ac332f4f63b51cae975279929dee4 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Thu, 22 Jan 2015 11:31:03 -0500 Subject: [PATCH] LP#1413624: AccessHandler Space delimination and bugfix In addition to commas, allow spaces to delimit option lists. Also, I apparently left a "!=" where I wanted a "ne" in _get_org_id. Signed-off-by: Thomas Berezansky Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/WWW/AccessHandler.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AccessHandler.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AccessHandler.pm index e9227e4cff..24f1d9e085 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AccessHandler.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AccessHandler.pm @@ -70,7 +70,7 @@ sub handler { my $failed = 0; if ($userperm) { - my @permissions = split(/\s*,\s*/, $userperm); + my @permissions = split(/\s*[ ,]\s*/, $userperm); $failed++ unless _verify_permission($auth_ses, $user, $checkou, \@permissions); } if (!$failed && $userstanding) { @@ -135,7 +135,7 @@ sub _get_org_id { ->create('open-ils.actor') ->request('open-ils.actor.org_unit.retrieve_by_shortname', $org_identifier) ->gather(1); - if ($org_unit && ref($org_unit) != 'HASH') { + if ($org_unit && ref($org_unit) ne 'HASH') { # We appear to have an org unit! So return the ID. return $org_unit->id; } @@ -166,7 +166,7 @@ sub _verify_home_ou { } } while ($org_tree); - my @home_ous = split(/\s*,\s*/,$home_ou); + my @home_ous = split(/\s*[ ,]\s*/,$home_ou); for my $cur_ou (@home_ous) { $cur_ou = _get_org_id($cur_ou); if ($user_orgs{$cur_ou}) { -- 2.43.2