Add more menu permissions user/mcooper/add-more-menu-perms
authorMark Cooper <markchristophercooper@gmail.com>
Mon, 8 Jul 2013 04:12:48 +0000 (21:12 -0700)
committerMark Cooper <markchristophercooper@gmail.com>
Mon, 8 Jul 2013 04:12:48 +0000 (21:12 -0700)
See - https://bugs.launchpad.net/evergreen/+bug/1066158

This is a first attempt to add additional permissions to various menu options - both admin and standard.
The problem is that often staff can access parts of the staff client interface that they don't have appropriate permissions for. This creates confusion for staff and is not very user friendly.

Where possible I'm taking the approach of identifying a single base permission that would be necessary to use the interface i.e.

cmd_acq_create_invoice => CREATE_INVOICE

Signed-off-by: Mark Cooper <markchristophercooper@gmail.com>
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

index 647ad70..50aa987 100644 (file)
     <command id="cmd_edit_user_buckets" />
 
     <command id="cmd_cat_main" />
-    <command id="cmd_create_marc" />
-    <command id="cmd_authority_manage" />
+    <command id="cmd_create_marc" 
+              perm="CREATE_MARC"
+             />
+    <command id="cmd_authority_manage" 
+             perm="IMPORT_AUTHORITY_MARC"
+             />
     <command id="cmd_url_verify" />
-    <command id="cmd_circ_checkout" />
+    <command id="cmd_circ_checkout" 
+             perm="COPY_CHECKOUT"
+             />
     <command id="cmd_patron_search" />
-    <command id="cmd_circ_checkin" />
+    <command id="cmd_circ_checkin" 
+             perm="COPY_CHECKIN"
+             />    
     <command id="cmd_circ_renew" />
     <command id="cmd_circ_hold_capture" />
     <command id="cmd_circ_hold_pull_list" />
     <command id="cmd_non_cat_type_edit" />
     <command id="cmd_copy_location_edit" />
     <command id="cmd_print_list_template_edit" />
-    <command id="cmd_z39_50_import" />
-    <command id="cmd_create_new_marc_book" />
-    <command id="cmd_marc_batch_edit" />
+    <command id="cmd_z39_50_import" 
+             perm="REMOTE_Z3950_QUERY"
+             />
+    <command id="cmd_create_new_marc_book" 
+             perm="CREATE_MARC"
+             />
+    <command id="cmd_marc_batch_edit" 
+             perm="UPDATE_MARC"
+             />
     <command id="cmd_replace_barcode" />
     <command id="cmd_reprint" />
     <command id="cmd_retrieve_last_patron" />
@@ -81,7 +95,9 @@
              perm="DEBUG_CLIENT"
              />
 
-    <command id="cmd_adv_user_edit" />
+    <command id="cmd_adv_user_edit" 
+             perm="UPDATE_USER"
+             />
     <command id="cmd_console"
              perm="DEBUG_CLIENT" />
     <command id="cmd_shell"
     <command id="cmd_xuleditor"
              perm="DEBUG_CLIENT"
              />
-    <command id="cmd_fieldmapper" />
+    <command id="cmd_fieldmapper" 
+             perm="DEBUG_CLIENT"
+             />    
     <command id="cmd_test_html" />
     <command id="cmd_test_xul" />
     <command id="cmd_clear_cache" />
 
     <command id="cmd_test" />
     <command id="cmd_broken" disabled="true" />
-    <command id="cmd_open_vandelay" />
+    <command id="cmd_open_vandelay" 
+             perm="UPDATE_MARC CREATE_MARC"
+             />
     
-    <command id="cmd_acq_create_invoice" />
-    <command id="cmd_acq_create_po" />
-    <command id="cmd_acq_view_my_pl" />
-    <command id="cmd_acq_view_local_po" />
-    <command id="cmd_acq_view_local_inv" />
-    <command id="cmd_acq_upload" />
-    <command id="cmd_acq_user_requests" />
-    <command id="cmd_acq_bib_search" />
-    <command id="cmd_acq_unified_search" />
-    <command id="cmd_acq_from_bib" />
-    <command id="cmd_acq_new_brief_record" />
-    <command id="cmd_acq_claim_eligible" />
-
-    <command id="cmd_booking_reservation" />
-    <command id="cmd_booking_pull_list" />
-    <command id="cmd_booking_capture" />
+    <command id="cmd_acq_create_invoice" 
+             perm="CREATE_INVOICE"
+             />
+    <command id="cmd_acq_create_po" 
+            perm="CREATE_PURCHASE_ORDER"
+             />
+    <command id="cmd_acq_view_my_pl" 
+             perm="CREATE_PICKLIST"
+             />
+    <command id="cmd_acq_view_local_po" 
+             perm="VIEW_PURCHASE_ORDER"
+             />
+    <command id="cmd_acq_view_local_inv" 
+             perm="VIEW_INVOICE"
+             />
+    <command id="cmd_acq_upload" 
+             perm="UPDATE_MARC CREATE_MARC"
+             />
+    <command id="cmd_acq_user_requests" 
+             perm="user_request.view"
+             />
+    <command id="cmd_acq_bib_search" 
+             perm="GENERAL_ACQ"
+             />
+    <command id="cmd_acq_unified_search" 
+             perm="GENERAL_ACQ"
+             />
+    <command id="cmd_acq_from_bib" 
+             perm="GENERAL_ACQ"
+             />
+    <command id="cmd_acq_new_brief_record" 
+             perm="GENERAL_ACQ UPDATE_MARC CREATE_MARC"
+             />
+    <command id="cmd_acq_claim_eligible" 
+             perm="MANAGE_CLAIM"
+             />
+
+    <command id="cmd_booking_reservation" 
+             perm="ADMIN_BOOKING_RESERVATION"
+             />
+    <command id="cmd_booking_pull_list" 
+             perm="RETRIEVE_RESERVATION_PULL_LIST"
+             />    
+    <command id="cmd_booking_capture" 
+             perm="CAPTURE_RESERVATION"
+             />
     <command id="cmd_booking_reservation_pickup" />
     <command id="cmd_booking_reservation_return" />
 
     <command id="cmd_local_admin_copy_locations" 
              perm="CREATE_COPY_LOCATION UPDATE_COPY_LOCATION DELETE_COPY_LOCATION"
              />
+    <command id="cmd_local_admin_lib_settings" 
+             perm="VIEW_ORG_SETTINGS UPDATE_ORG_UNIT"
+             />
     <command id="cmd_local_admin_lib_settings" />
     <command id="cmd_local_admin_non_cat_types" 
              perm="CREATE_NON_CAT_TYPE UPDATE_NON_CAT_TYPE DELETE_NON_CAT_TYPE"
     <command id="cmd_server_admin_acn_suffix" 
              perm="CREATE_VOLUME_SUFFIX DELETE_VOLUME_SUFFIX UPDATE_VOLUME_SUFFIX"
              />
-    <command id="cmd_server_admin_acq_invoice_item_type" />
-    <command id="cmd_server_admin_acq_invoice_payment_method" />
-    <command id="cmd_server_admin_acq_cancel_reason" />
-    <command id="cmd_server_admin_acq_lineitem_alert" />
-    <command id="cmd_server_admin_acq_lineitem_marc_attr_def" />
-    <command id="cmd_server_admin_acq_fund_tag" />
-    <command id="cmd_server_admin_acq_claim_type" />
-    <command id="cmd_server_admin_acq_claim_event_type" />
-    <command id="cmd_server_admin_acq_claim_policy" />
-    <command id="cmd_server_admin_acq_claim_policy_action" />
-    <command id="cmd_server_admin_acq_fund" />
-    <command id="cmd_server_admin_acq_funding_source" />
-    <command id="cmd_server_admin_acq_provider" />
-    <command id="cmd_server_admin_acq_edi_account" />
-    <command id="cmd_server_admin_acq_edi_message" />
-    <command id="cmd_server_admin_acq_currency_type" />
-    <command id="cmd_server_admin_acq_exchange_rate" />
-    <command id="cmd_server_admin_acq_distrib_formula" />
+    <command id="cmd_server_admin_acq_invoice_item_type" 
+             perm="CREATE_INVOICE_ITEM_TYPE"
+             />
+    <command id="cmd_server_admin_acq_invoice_payment_method" 
+             perm="ADMIN_INVOICE_METHOD"
+             />    
+    <command id="cmd_server_admin_acq_cancel_reason" 
+             perm="ADMIN_ACQ_CANCEL_CAUSE"
+             />
+    <command id="cmd_server_admin_acq_lineitem_alert" 
+             perm="ADMIN_ACQ_LINEITEM_ALERT_TEXT"
+             />    
+    <command id="cmd_server_admin_acq_lineitem_marc_attr_def" 
+             perm="ADMIN_LINEITEM_MARC_ATTR_DEF"
+             />    
+    <command id="cmd_server_admin_acq_fund_tag" 
+             perm="ADMIN_ACQ_FUND_TAG"
+             />    
+    <command id="cmd_server_admin_acq_claim_type" 
+             perm="ADMIN_ACQ_CLAIM_TYPE"
+             />    
+    <command id="cmd_server_admin_acq_claim_event_type" 
+             perm="ADMIN_ACQ_CLAIM_EVENT_TYPE"
+             />    
+    <command id="cmd_server_admin_acq_claim_policy" 
+             perm="ADMIN_CLAIM_POLICY"
+             />    
+    <command id="cmd_server_admin_acq_claim_policy_action" 
+             perm="ADMIN_CLAIM_POLICY"
+             />    
+    <command id="cmd_server_admin_acq_fund" 
+             perm="VIEW_FUND"
+             />    
+    <command id="cmd_server_admin_acq_funding_source" 
+             perm="VIEW_FUNDING_SOURCE"
+             />    
+    <command id="cmd_server_admin_acq_provider" 
+             perm="VIEW_PROVIDER"
+             />    
+    <command id="cmd_server_admin_acq_edi_account" 
+             perm="GENERAL_ACQ"
+             />    
+    <command id="cmd_server_admin_acq_edi_message" 
+             perm="GENERAL_ACQ"
+             />    
+    <command id="cmd_server_admin_acq_currency_type" 
+             perm="ADMIN_CURRENCY_TYPE"
+             />    
+    <command id="cmd_server_admin_acq_exchange_rate" 
+             perm="ADMIN_CURRENCY_TYPE"
+             />    
+    <command id="cmd_server_admin_acq_distrib_formula" 
+             perm="ADMIN_ACQ_DISTRIB_FORMULA"
+             />    
     <command id="cmd_server_admin_sms_carrier" 
              perm="ADMIN_SMS_CARRIER"
              />
              perm="ADMIN_AGE_PROTECT_RULE"
              />
 
-    <command id="cmd_server_admin_authority_control_set" />
-    <command id="cmd_server_admin_authority_thesaurus" />
-    <command id="cmd_server_admin_authority_browse_axis" />
+    <command id="cmd_server_admin_authority_control_set" 
+             perm="IMPORT_AUTHORITY_MARC"
+             />
+    <command id="cmd_server_admin_authority_thesaurus" 
+             perm="IMPORT_AUTHORITY_MARC"
+             />
+    <command id="cmd_server_admin_authority_browse_axis" 
+             perm="IMPORT_AUTHORITY_MARC"
+             />
 
-    <command id="cmd_server_admin_booking_resource" />
-    <command id="cmd_server_admin_booking_resource_type" />
-    <command id="cmd_server_admin_booking_resource_attr" />
-    <command id="cmd_server_admin_booking_resource_attr_value" />
-    <command id="cmd_server_admin_booking_resource_attr_map" />
+    <command id="cmd_server_admin_booking_resource" 
+             perm="ADMIN_BOOKING_RESOURCE"
+             />
+    <command id="cmd_server_admin_booking_resource_type" 
+             perm="ADMIN_BOOKING_RESOURCE_TYPE"
+             />    
+    <command id="cmd_server_admin_booking_resource_attr" 
+             perm="ADMIN_BOOKING_RESOURCE_ATTR"
+             />    
+    <command id="cmd_server_admin_booking_resource_attr_value" 
+             perm="ADMIN_BOOKING_RESOURCE_ATTR_VALUE"
+             />    
+    <command id="cmd_server_admin_booking_resource_attr_map" 
+             perm="ADMIN_BOOKING_RESOURCE_ATTR_MAP"
+             />    
     <command id="cmd_server_admin_config_circ_weights"
              perm="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT"
              />
     <command id="cmd_hotkeys_set" />
     <command id="cmd_hotkeys_setworkstation" />
     <command id="cmd_hotkeys_clearworkstation" />
-    <command id="cmd_toolbar_configure" />
+    <command id="cmd_toolbar_configure" 
+             perm="ADMIN_TOOLBAR"
+             />
     <command id="cmd_toolbar_set" />
     <command id="cmd_toolbar_setworkstation" />
     <command id="cmd_toolbar_clearworkstation" />