git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5dfd502
)
hide non-member slices, even from admin
author
Scott Baker
<smbaker@gmail.com>
Mon, 14 Jul 2014 19:24:03 +0000
(12:24 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Mon, 14 Jul 2014 19:24:03 +0000
(12:24 -0700)
planetstack/core/xoslib/static/js/xosDeveloper.js
patch
|
blob
|
history
diff --git
a/planetstack/core/xoslib/static/js/xosDeveloper.js
b/planetstack/core/xoslib/static/js/xosDeveloper.js
index
94749f1
..
99641c3
100644
(file)
--- 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",
\r
DeveloperApp.SliceListView = Marionette.CompositeView.extend({
tagName: "table",
\r
- className: "table table-bordered",
\r
+ className: "table table-bordered
table-striped
",
\r
template: "#developer-slicetable-template",
\r
childView: DeveloperApp.SliceDetailView,
\r
childViewContainer: "tbody",
\r
template: "#developer-slicetable-template",
\r
childView: DeveloperApp.SliceDetailView,
\r
childViewContainer: "tbody",
\r
@@
-27,7
+27,16
@@
DeveloperApp.SliceListView = Marionette.CompositeView.extend({
this.collection.sortVar = fieldName;
\r
this.collection.sortOrder = order;
\r
this.collection.sort();
\r
this.collection.sortVar = fieldName;
\r
this.collection.sortOrder = order;
\r
this.collection.sort();
\r
- }
\r
+ },
\r
+
\r
+ attachHtml: function(compositeView, childView, index) {
\r
+ // The REST API will let admin users see everything. For the developer
\r
+ // view we still want to hide slices we are not members of.
\r
+ if (childView.model.get("sliceInfo").roles.length == 0) {
\r
+ return;
\r
+ }
\r
+ DeveloperApp.SliceListView.__super__.attachHtml(compositeView, childView, index);
\r
+ },
\r
});
\r
DeveloperApp.on("start", function() {
});
\r
DeveloperApp.on("start", function() {