# user is automatically opted-in if they are from the local org
return 1 if $user->home_ou eq $ws_org;
- # get the boundary setting
- my $opt_boundary = $U->ou_ancestor_setting_value($e->requestor->ws_ou,'org.patron_opt_boundary');
-
- # auto opt in if user falls within the opt boundary
- my $opt_orgs = $U->get_org_descendants($ws_org, $opt_boundary);
-
- return 1 if grep $_ eq $user->home_ou, @$opt_orgs;
-
# check whether opt-in is restricted at the user's home library
my $opt_restrict_depth = $U->ou_ancestor_setting_value($user->home_ou, 'org.restrict_opt_to_depth');
if ($opt_restrict_depth) {
return 2 unless grep $_ eq $e->requestor->ws_ou, @$unrestricted_orgs;
}
+ # get the boundary setting
+ my $opt_boundary = $U->ou_ancestor_setting_value($e->requestor->ws_ou,'org.patron_opt_boundary');
+
+ # auto opt in if user falls within the opt boundary
+ my $opt_orgs = $U->get_org_descendants($ws_org, $opt_boundary);
+
+ return 1 if grep $_ eq $user->home_ou, @$opt_orgs;
+
my $vals = $e->search_actor_usr_org_unit_opt_in(
{org_unit=>$opt_orgs, usr=>$user_id},{idlist=>1});