permissions for css library setting with separate upgrade script from the original... user/rogan/lp1849683_v2
authorRogan Hamby <rogan.hamby@gmail.com>
Thu, 24 Oct 2019 17:29:36 +0000 (13:29 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Thu, 24 Oct 2019 17:29:36 +0000 (13:29 -0400)
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.css_opac_permission.sql [new file with mode: 0644]
docs/RELEASE_NOTES_NEXT/OPAC/custom_css_in_opac.adoc

index 32dcd0f..60e08e3 100644 (file)
@@ -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 (file)
index 0000000..aefb2fc
--- /dev/null
@@ -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;
index ab0f2ab..203a056 100644 (file)
@@ -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.