privileges
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 4 Nov 2005 21:09:17 +0000 (21:09 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 4 Nov 2005 21:09:17 +0000 (21:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1956 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/main/window.js
Open-ILS/xul/staff_client/chrome/content/evergreen/util/error.js

index 6132c04..83f34c7 100644 (file)
@@ -30,6 +30,11 @@ main.window.prototype = {
                var w;
 
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesRead");
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
+
                const CI = Components.interfaces;
                const PB = Components.classes["@mozilla.org/preferences-service;1"].getService(CI.nsIPrefBranch);
 
@@ -38,7 +43,6 @@ main.window.prototype = {
                        // pref 'dom.disable_open_during_load' is the main popup blocker preference
                        blocked = PB.getBoolPref("dom.disable_open_during_load");
                        if(blocked) PB.setBoolPref("dom.disable_open_during_load",false);
-
                        w = this.win.open(url,title,features);
                } catch(E) {
                        this.error.sdump('D_ERROR','window.SafeWindowOpen: ' + E + '\n');
@@ -50,6 +54,7 @@ main.window.prototype = {
        },
 
        'open' : function(url,title,features) {
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                this.error.sdump('D_WIN',
                        'opening ' + url + ', ' + title + ', ' + features + ' from ' + this.win + '\n');
                var w = this.SafeWindowOpen(url,title,features);
index 4361c1c..727c155 100644 (file)
@@ -4,6 +4,7 @@ if (typeof util == 'undefined') util = {};
 util.error = function () {
 
        try {
+               netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                this.consoleService = Components.classes['@mozilla.org/consoleservice;1']
                        .getService(Components.interfaces.nsIConsoleService);
        } catch(E) {
@@ -94,8 +95,10 @@ util.error.prototype = {
                                this.sdump_last_time = now;
                                if (this.debugDump)
                                        this.debug(message);
-                               if (this.consoleDump)
+                               if (this.consoleDump) {
+                                       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                                        this.consoleService.logStringMessage(message);
+                               }
                        }
                } catch(E) {
                        dump('Calling sdump but ' + E + '\n');