From 3b9b5e7b22d2b39f11dc518d1023abac9d067901 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 28 Oct 2019 19:30:57 -0400 Subject: [PATCH] LP1849683: Permission for custom css setting Add a permission to restrict who has access to the Custom CSS for the OPAC setting. Signed-off-by: Rogan Hamby Signed-off-by: Jason Boyer --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 16 ++++++---------- .../XXXX.data.opac_custom_css_permission.sql | 12 ++++++++++++ .../OPAC/custom_css_in_opac.adoc | 3 +++ 3 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac_custom_css_permission.sql create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc 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 e7e1a377fe..12cbafdfbd 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,9 @@ 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, 'UPDATE_ORG_UNIT_SETTING.opac.patron.custom_css', oils_i18n_gettext(620, + 'Update CSS setting for the OPAC', 'ppl', 'description')) ; @@ -4408,15 +4410,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', @@ -5555,6 +5548,9 @@ INSERT into config.org_unit_setting_type 'bool', null) ; +INSERT INTO config.org_unit_setting_type ( name, label, grp, description, datatype, update_perm ) +VALUES ('opac.update.css','Setting CSS in the OPAC','opac','Setting CSS in the OPAC','string',620); + UPDATE config.org_unit_setting_type SET view_perm = (SELECT id FROM permission.perm_list WHERE code = 'VIEW_CREDIT_CARD_PROCESSING' LIMIT 1) diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac_custom_css_permission.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac_custom_css_permission.sql new file mode 100644 index 0000000000..e7923affe1 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac_custom_css_permission.sql @@ -0,0 +1,12 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO permission.perm_list ( id, code, description ) VALUES +( 620, 'UPDATE_ORG_UNIT_SETTING.opac.patron.custom_css', oils_i18n_gettext(620, + 'Update CSS setting for the OPAC', 'ppl', 'description')) +; + +UPDATE config.org_unit_setting_type SET update_perm = 620 WHERE name = 'opac.patron.custom_css'; + +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 new file mode 100644 index 0000000000..30309565ae --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc @@ -0,0 +1,3 @@ +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. The permission UPDATE_ORG_UNIT_SETTING.opac.patron.custom_css manages access to it. -- 2.43.2