From 20253abae3dd4e21f8bbc2db8568bef27834a78c Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Thu, 24 Oct 2019 13:29:36 -0400 Subject: [PATCH] permissions for css library setting with separate upgrade script from the original css one Signed-off-by: Rogan Hamby --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 26 +++++++++++++--------- .../Pg/upgrade/XXXX.data.css_opac_permission.sql | 14 ++++++++++++ .../OPAC/custom_css_in_opac.adoc | 3 +-- 3 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.css_opac_permission.sql 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..60e08e37ad 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/XXXX.data.css_opac_permission.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.css_opac_permission.sql new file mode 100644 index 0000000000..aefb2fce0a --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.css_opac_permission.sql @@ -0,0 +1,14 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +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')) +; + +UPDATE config.org_unit_setting_type SET view_perm = 620, update_perm = 621 WHERE name = 'opac.update.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 index ab0f2abb1e..203a056914 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,5 @@ 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