From 8d748bd69eb6d75ad4c6fc7360bcae5e9a52a41a 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 +- .../content/OpenILS/util_overlay_chrome.xul | 2 +- .../content/OpenILS/util_overlay_offline.xul | 2 +- .../chrome/content/auth/controller.js | 2 + .../staff_client/chrome/content/main/main.js | 15 +++++++ .../staff_client/chrome/content/main/menu.js | 40 +++++++++++++++++ .../chrome/content/main/menu_frame_menus.xul | 44 ++++++++++++++----- .../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 1c84e9767b..441b2b9828 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1440,7 +1440,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES ( 511, 'PERSISTENT_LOGIN', oils_i18n_gettext( 511, 'Allows a user to authenticate and get a long-lived session (length configured in opensrf.xml)', '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 fdfb446b93..c4b023bcdf 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 @@ -71,7 +71,7 @@