From d01c1cc96d145ad0fb56a616800afc5d9e568edb Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Thu, 24 Oct 2019 11:19:00 -0400 Subject: [PATCH] permissions added for css library setting and updated release note Signed-off-by: Rogan Hamby --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 26 +++++++++++++-------- .../sql/Pg/upgrade/1196.data.opac_custom_css.sql | 27 ++++++++++++++-------- .../OPAC/custom_css_in_opac.adoc | 2 +- 3 files changed, 34 insertions(+), 21 deletions(-) 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 32dcd0fffa..f778c31b53 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1933,7 +1933,11 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES ( 618, 'CREATE_PRECAT', oils_i18n_gettext(618, 'Allows a user to create a pre-catalogued copy', 'ppl', 'description')), ( 619, 'EDIT_SELF_IN_CLIENT', oils_i18n_gettext(619, - 'Allow a user to edit their own account in the staff client', 'ppl', 'description')) + 'Allow a user to edit their own account in the staff client', 'ppl', 'description')), + ( 620, 'VIEW_ORG_UNIT_SETTING.opac.patron.custom_css', oils_i18n_gettext(620, + 'Viewing CSS setting for the OPAC', 'ppl', 'description')), + ( 621, 'UPDATE_ORG_UNIT_SETTING.opac.patron.custom_css', oils_i18n_gettext(621, + 'Update CSS setting for the OPAC', 'ppl', 'description')) ; @@ -4408,15 +4412,6 @@ INSERT into config.org_unit_setting_type 'coust', 'description'), 'integer', null) -,( 'opac.patron.custom_css', 'opac', - oils_i18n_gettext('opac.patron.custom_css', - 'Custom CSS for the OPAC', - 'coust', 'label'), - oils_i18n_gettext('opac.patron.custom_css', - 'Custom CSS for the OPAC', - 'coust', 'description'), - 'string', NULL) - ,( 'opac.payment_history_age_limit', 'opac', oils_i18n_gettext('opac.payment_history_age_limit', 'Payment History Age Limit', @@ -15292,6 +15287,17 @@ INSERT INTO config.global_flag (name, enabled, label) ) ); +INSERT INTO config.org_unit_setting_type ( name, label, grp, description, datatype, view_perm, update_perm ) + VALUES ( + 'opac.update.css', + 'Setting CSS in the OPAC', + 'opac', + 'Setting CSS in the OPAC', + 'string', + 620, + 621 + ); + INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, grp, update_perm ) VALUES ( 'ui.hide_copy_editor_fields', diff --git a/Open-ILS/src/sql/Pg/upgrade/1196.data.opac_custom_css.sql b/Open-ILS/src/sql/Pg/upgrade/1196.data.opac_custom_css.sql index da51d9b61f..3ca6f64c20 100644 --- a/Open-ILS/src/sql/Pg/upgrade/1196.data.opac_custom_css.sql +++ b/Open-ILS/src/sql/Pg/upgrade/1196.data.opac_custom_css.sql @@ -2,15 +2,22 @@ BEGIN; SELECT evergreen.upgrade_deps_block_check('1196', :eg_version); -INSERT into config.org_unit_setting_type -( name, grp, label, description, datatype, fm_class ) VALUES -( 'opac.patron.custom_css', 'opac', - oils_i18n_gettext('opac.patron.custom_css', - 'Custom CSS for the OPAC', - 'coust', 'label'), - oils_i18n_gettext('opac.patron.custom_css', - 'Custom CSS for the OPAC', - 'coust', 'description'), - 'string', NULL); +INSERT INTO permission.perm_list ( id, code, description ) VALUES +( 620, 'VIEW_ORG_UNIT_SETTING.opac.patron.custom_css', oils_i18n_gettext(620, + 'Viewing CSS setting for the OPAC', 'ppl', 'description')), +( 621, 'UPDATE_ORG_UNIT_SETTING.opac.patron.custom_css', oils_i18n_gettext(621, + 'Update CSS setting for the OPAC', 'ppl', 'description')) +; + +INSERT INTO config.org_unit_setting_type ( name, label, grp, description, datatype, view_perm, update_perm ) + VALUES ( + 'opac.update.css', + 'Setting CSS in the OPAC', + 'opac', + 'Setting CSS in the OPAC', + 'string', + 620, + 621 + ); COMMIT; diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc index ab0f2abb1e..cba6266ad5 100644 --- a/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc +++ b/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc @@ -1,6 +1,6 @@ Custom CSS in OPAC ^^^^^^^^^^^^^^^^^^ -There is now a library setting called opac.patron.custom_css. This can be populated with CSS that will load in the OPAC after the stylesheets and allow for custom CSS without editing server side templates. +There is now a library setting called opac.patron.custom_css. This can be populated with CSS that will load in the OPAC after the stylesheets and allow for custom CSS without editing server side templates. The permissions VIEW_ORG_UNIT_SETTING.opac.patron.custom_css and UPDATE_ORG_UNIT_SETTING.opac.patron.custom_css manage access to it. -- 2.11.0