hide non-member slices, even from admin
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.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 @@
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() {