Do not attempt to filter out Z39.50 services by permission when
retrieveing the services in a non-authenticate manner (i.e. from within
the Z39.50 code). Otherwise, the code will die on $e->requestor->id,
because there is no requestor.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
};
# then filter out any services which the requestor lacks the perm for
- foreach my $s (keys %{ $hash }) {
- if ($$hash{$s}{use_perm}) {
- if ($U->check_perms(
- $e->requestor->id,
- $e->requestor->ws_ou,
- $$hash{$s}{use_perm}
- )) {
- delete $$hash{$s};
- }
- };
+ if ($editor_with_authtoken) {
+ foreach my $s (keys %{ $hash }) {
+ if ($$hash{$s}{use_perm}) {
+ if ($U->check_perms(
+ $e->requestor->id,
+ $e->requestor->ws_ou,
+ $$hash{$s}{use_perm}
+ )) {
+ delete $$hash{$s};
+ }
+ };
+ }
}
%services = %$hash; # cache these internally so we can actually use the db-configured sources