LP1849683: Permission for custom css setting
authorRogan Hamby <rogan.hamby@gmail.com>
Mon, 28 Oct 2019 23:30:57 +0000 (19:30 -0400)
committerJason Boyer <JBoyer@eoli.info>
Tue, 31 Mar 2020 10:55:15 +0000 (06:55 -0400)
Add a permission to restrict who has access to
the Custom CSS for the OPAC setting.

Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Jason Boyer <JBoyer@eoli.info>

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.opac_custom_css_permission.sql [new file with mode: 0644]
docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc [new file with mode: 0644]

index e7e1a37..12cbafd 100644 (file)
@@ -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 (file)
index 0000000..e7923af
--- /dev/null
@@ -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 (file)
index 0000000..3030956
--- /dev/null
@@ -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.