permissions
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 11 Dec 2005 06:31:59 +0000 (06:31 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 11 Dec 2005 06:31:59 +0000 (06:31 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2330 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/OpenILS/data.js

index 72282d7..f0ce596 100644 (file)
@@ -33,6 +33,7 @@ OpenILS.data.prototype = {
 
        'stash' : function () {
                try {
+                       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
                        var data_cache=new OpenILS( );
                        for (var i = 0; i < arguments.length; i++) {
@@ -46,6 +47,7 @@ OpenILS.data.prototype = {
 
        '_debug_stash' : function() {
                try {
+                       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
                        var data_cache=new OpenILS( );
                        for (var i in data_cache.wrappedJSObject.OpenILS.prototype.data) {
@@ -68,16 +70,21 @@ OpenILS.data.prototype = {
        },
 
        'stash_retrieve' : function() {
-               const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
-               var data_cache=new OpenILS( );
-               var dc = data_cache.wrappedJSObject.OpenILS.prototype.data;
-               for (var i in dc) {
-                       this.error.sdump('D_DATA','Retrieving ' + i + ' : ' + dc[i] + '\n');
-                       this[i] = dc[i];
-               }
-               if (typeof this.on_complete == 'function') {
+               try {
+                       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                       const OpenILS=new Components.Constructor("@mozilla.org/openils_data_cache;1", "nsIOpenILS");
+                       var data_cache=new OpenILS( );
+                       var dc = data_cache.wrappedJSObject.OpenILS.prototype.data;
+                       for (var i in dc) {
+                               this.error.sdump('D_DATA','Retrieving ' + i + ' : ' + dc[i] + '\n');
+                               this[i] = dc[i];
+                       }
+                       if (typeof this.on_complete == 'function') {
 
-                       this.on_complete();
+                               this.on_complete();
+                       }
+               } catch(E) {
+                       this.error.sdump('D_ERROR','Error in OpenILS.data._debug_stash(): ' + js2JSON(E) );
                }
        },