|
@@ -132,11 +132,12 @@ Router.route("/admin/alerts", {
|
|
|
|
|
|
Router.route("/:type", {
|
|
Router.route("/:type", {
|
|
waitOn: function() {
|
|
waitOn: function() {
|
|
- return [Meteor.subscribe("isModerator", Meteor.userId()), Meteor.subscribe("isAdmin", Meteor.userId())];
|
|
|
|
|
|
+ return [Meteor.subscribe("isModerator", Meteor.userId()), Meteor.subscribe("isAdmin", Meteor.userId()), Meteor.subscribe("rooms")];
|
|
},
|
|
},
|
|
action: function() {
|
|
action: function() {
|
|
var user = Meteor.users.findOne({});
|
|
var user = Meteor.users.findOne({});
|
|
- if (user !== undefined && user.profile !== undefined && (user.profile.rank === "admin" || user.profile.rank === "moderator")) {
|
|
|
|
|
|
+ var room = Rooms.findOne({type: this.params.type});
|
|
|
|
+ if ((room.private === true && user !== undefined && user.profile !== undefined && (user.profile.rank === "admin" || user.profile.rank === "moderator")) || room.private === false) {
|
|
this.render("room");
|
|
this.render("room");
|
|
} else {
|
|
} else {
|
|
this.redirect("/");
|
|
this.redirect("/");
|