From 23fc0a16286766b76605822391feae6484511580 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Mon, 15 Aug 2011 08:59:31 -0400 Subject: [PATCH] Require permission or pref to debug in client Disables all debug functions I know of unless: 1 - You have new DEBUG_CLIENT permission (after login) This should work even on operator change. Once a given debug interface is open you can change operator back. 2 - You have a client with the debug preference enabled This causes the client in all places I touched to think you have DEBUG_CLIENT This also allows debugging *before* login, including in the Standalone interface. Debug functions I know of: Debug box on login page (already protected by pref) Debug items in Admin menu Venkman Javascript Shells Inspector Chrome List CTRL+SHIFT+F7 debug box in overlays Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 4 +- .../chrome/content/OpenILS/util_overlay_chrome.xul | 2 +- .../content/OpenILS/util_overlay_offline.xul | 2 +- .../staff_client/chrome/content/auth/controller.js | 2 + .../xul/staff_client/chrome/content/main/main.js | 15 ++++++++ .../xul/staff_client/chrome/content/main/menu.js | 40 ++++++++++++++++++++ .../chrome/content/main/menu_frame_menus.xul | 44 ++++++++++++++++------ .../staff_client/server/OpenILS/util_overlay.xul | 2 +- 8 files changed, 96 insertions(+), 15 deletions(-) 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 3751ba44aa..43c3892a0f 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1431,7 +1431,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES ( 510, 'UPDATE_PATRON_COLLECTIONS_EXEMPT', oils_i18n_gettext(510, 'Allows a user to indicate that a patron is exempt from collections processing', 'ppl', 'description')), ( 512, 'ACQ_INVOICE_REOPEN', oils_i18n_gettext( 512, - 'Allows a user to reopen an Acquisitions invoice', 'ppl', 'description' )); + 'Allows a user to reopen an Acquisitions invoice', 'ppl', 'description' )), + ( 513, 'DEBUG_CLIENT', oils_i18n_gettext( 513, + 'Allows a user to use debug functions in the staff client', 'ppl', 'description' )); SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000); diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul index c635ab34ca..b0085d03a3 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul @@ -68,7 +68,7 @@