From: senator Date: Mon, 20 Sep 2010 22:47:35 +0000 (+0000) Subject: How about one more permission check for serials here? Need more comprehensive X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5b07792c1802070cff094aee62f2918d541b2f1f;p=evergreen%2Fmasslnc.git How about one more permission check for serials here? Need more comprehensive review of this later. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17853 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm index 9dce7261a6..f6b53cb7ee 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm @@ -1247,6 +1247,7 @@ sub receive_items_one_unit_per { my $e = new_editor("authtoken" => $auth, "xact" => 1); return $e->die_event unless $e->checkauth; + return $e->die_event unless $e->allowed("RECEIVE_SERIAL"); my $user_id = $e->requestor->id; diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index e90f171d52..b5ed5758ee 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0408'); -- gmc +INSERT INTO config.upgrade_log (version) VALUES ('0409'); -- senator CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 626b44a65c..f9458d1d87 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1389,6 +1389,7 @@ INSERT INTO permission.perm_list VALUES ,(398, 'ADMIN_SERIAL_SUBSCRIPTION', oils_i18n_gettext(398, 'Create/update/delete serial subscription objects', 'ppl', 'description')) ,(399, 'ADMIN_SERIAL_DISTRIBUTION', oils_i18n_gettext(399, 'Create/update/delete serial distribution objects', 'ppl', 'description')) ,(400, 'ADMIN_SERIAL_STREAM', oils_i18n_gettext(400, 'Create/update/delete serial stream objects', 'ppl', 'description')) + ,(401, 'RECEIVE_SERIAL', oils_i18n_gettext(401, 'Receive serial items', 'ppl', 'description')) ; diff --git a/Open-ILS/src/sql/Pg/upgrade/0409.data.receive-serial-perm.sql b/Open-ILS/src/sql/Pg/upgrade/0409.data.receive-serial-perm.sql new file mode 100644 index 0000000000..72f2851be3 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0409.data.receive-serial-perm.sql @@ -0,0 +1,8 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0409'); -- senator + +INSERT INTO permission.perm_list (id, code, description) VALUES + (401, 'RECEIVE_SERIAL', oils_i18n_gettext(401, 'Receive serial items', 'ppl', 'description')); + +COMMIT;