Provide permission for copy editor field hiding
authorMike Rylander <mrylander@gmail.com>
Thu, 16 Aug 2012 17:45:23 +0000 (13:45 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 16 Aug 2012 19:15:42 +0000 (15:15 -0400)
We can adjust what fields are available in the copy editor in 2.2+, but that
requires the general UPDATE_ORG_SETTING permission.  The YAOUS-specific
permission here allows more granular control, so that staff can be given the
ability to adjust only that one OU setting.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.copy_editor_perms.sql [new file with mode: 0644]

index d8d91ba..37a8b9b 100644 (file)
@@ -1565,7 +1565,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 537, 'ADMIN_SEARCH_FILTER_GROUP', oils_i18n_gettext( 537,
     'Allows staff to manage search filter groups and entries', 'ppl', 'description' )),
  ( 538, 'VIEW_SEARCH_FILTER_GROUP', oils_i18n_gettext( 538,
-    'Allows staff to view search filter groups and entries', 'ppl', 'description' ))
+    'Allows staff to view search filter groups and entries', 'ppl', 'description' )),
+ ( 539, 'UPDATE_ui.hide_copy_editor_fields', oils_i18n_gettext( 539,
+    'Allows staff to edit displayed copy editor fields', 'ppl', 'description' ))
 ;
 
 
@@ -11668,7 +11670,7 @@ INSERT INTO config.global_flag (name, enabled, label)
         )
     );
 
-INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, grp )
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, grp, update_perm )
     VALUES (
         'ui.hide_copy_editor_fields',
         oils_i18n_gettext(
@@ -11686,7 +11688,8 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, g
             'description'
         ),
         'array',
-        'gui'
+        'gui',
+        539
     );
 
 INSERT into config.org_unit_setting_type 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.copy_editor_perms.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.copy_editor_perms.sql
new file mode 100644 (file)
index 0000000..3bbc2bc
--- /dev/null
@@ -0,0 +1,6 @@
+
+INSERT INTO permission.perm_list (id, code, description)
+    VALUES (539, 'UPDATE_ui.hide_copy_editor_fields', 'Allows staff to edit displayed copy editor fields');
+
+UPDATE config.org_unit_setting_type SET update_perm = 539 WHERE name = 'ui.hide_copy_editor_fields';
+