From 0393e5d0a89f6e03a54a3477efb49a33446641c2 Mon Sep 17 00:00:00 2001
From: Scott Baker <smbaker@gmail.com>
Date: Mon, 14 Jul 2014 12:24:03 -0700
Subject: [PATCH] hide non-member slices, even from admin

---
 planetstack/core/xoslib/static/js/xosDeveloper.js | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/planetstack/core/xoslib/static/js/xosDeveloper.js b/planetstack/core/xoslib/static/js/xosDeveloper.js
index 94749f1..99641c3 100644
--- a/planetstack/core/xoslib/static/js/xosDeveloper.js
+++ b/planetstack/core/xoslib/static/js/xosDeveloper.js
@@ -12,7 +12,7 @@ DeveloperApp.SliceDetailView = Marionette.ItemView.extend({
 
 DeveloperApp.SliceListView = Marionette.CompositeView.extend({
   tagName: "table",
-  className: "table table-bordered",
+  className: "table table-bordered table-striped",
   template: "#developer-slicetable-template",
   childView: DeveloperApp.SliceDetailView,
   childViewContainer: "tbody",
@@ -27,7 +27,16 @@ DeveloperApp.SliceListView = Marionette.CompositeView.extend({
       this.collection.sortVar = fieldName;
       this.collection.sortOrder = order;
       this.collection.sort();
-  }
+  },
+
+  attachHtml: function(compositeView, childView, index) {
+      // The REST API will let admin users see everything. For the developer
+      // view we still want to hide slices we are not members of.
+      if (childView.model.get("sliceInfo").roles.length == 0) {
+          return;
+      }
+      DeveloperApp.SliceListView.__super__.attachHtml(compositeView, childView, index);
+  },
 });
 
 DeveloperApp.on("start", function() {
-- 
2.47.0