From ca613699636a311956c2d656a625c1197c452b39 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 20 May 2008 00:51:23 -0700 Subject: [PATCH] Fix for bug where read-write notebooks that the anonymous user had read-only access to would show up as read-only, even when logged in. --- NEWS | 4 ++++ static/js/Wiki.js | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index afe2af8..8772714 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +1.3.36: May 19, 2008 + * Fix for bug where read-write notebooks that the anonymous user had + read-only access to would show up as read-only, even when logged in. + 1.3.35: May 19, 2008 * Potential fix for bug where caching of Notebook objects can cause read-write notebooks to display as read-only. diff --git a/static/js/Wiki.js b/static/js/Wiki.js index becfedb..a4278e9 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -38,9 +38,13 @@ function Wiki( invoker ) { this.notebooks_by_id = {}; for ( var i in this.notebooks ) { - this.notebooks_by_id[ this.notebooks[ i ].object_id ] = this.notebooks[ i ]; - if ( this.notebooks[ i ].object_id == this.notebook_id ) - this.notebook = this.notebooks[ i ] + var notebook = this.notebooks[ i ]; + + if ( !this.notebooks_by_id[ notebook.object_id ] ) + this.notebooks_by_id[ notebook.object_id ] = notebook; + + if ( !this.notebook && notebook.object_id == this.notebook_id ) + this.notebook = notebook; } if ( this.notebook && this.notebook.read_write ) {