From 2875ff3f2bb69bd446a9cb92d11deffa4cc0589c Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Fri, 17 Jan 2014 14:29:46 +0000 Subject: [PATCH] Explaining why we check for no metadata --- lib/models/bin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/models/bin.js b/lib/models/bin.js index 46503af5..64706b8d 100644 --- a/lib/models/bin.js +++ b/lib/models/bin.js @@ -31,7 +31,10 @@ var model = { }.bind(this)); }, isVisible: function (bin, username) { - if (!bin.metadata) { // bin does not exist yet, it cannot be private + // This will only occur if it isn't a real bin, it has been created + // on from default files and does not exist in any database. By this + // logic the bin must be public, it has no owner and no record. + if (!bin.metadata) { return true; } // this should only let users see the latest