From: erickson Date: Thu, 11 Jun 2009 13:50:39 +0000 (+0000) Subject: backporting 12264 : added support for the global UPDATE_ORG_UNIT_SETTING_ALL permissi... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7418f7acd65b726aaf762436bce527ba1c9572b2;p=Evergreen.git backporting 12264 : added support for the global UPDATE_ORG_UNIT_SETTING_ALL permission, which overrides individual org-setting perms git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4_0@13368 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 538989fb3f..96af5b9d34 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -100,11 +100,15 @@ sub set_ou_settings { my $e = new_editor(authtoken => $auth, xact => 1); return $e->die_event unless $e->checkauth; + my $all_allowed = $e->allowed("UPDATE_ORG_UNIT_SETTING_ALL", $org_id); + for my $name (keys %$settings) { my $val = $$settings{$name}; my $set = $e->search_actor_org_unit_setting({org_unit => $org_id, name => $name})->[0]; - return $e->die_event unless $e->allowed("UPDATE_ORG_UNIT_SETTING.$name", $org_id); + unless($all_allowed) { + return $e->die_event unless $e->allowed("UPDATE_ORG_UNIT_SETTING.$name", $org_id); + } if(defined $val) { $val = OpenSRF::Utils::JSON->perl2JSON($val);