2
0
Эх сурвалжийг харах

Made admin page require admin rank.

KrisVos130 9 жил өмнө
parent
commit
c3b548da52
1 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 6 2
      app/app.js

+ 6 - 2
app/app.js

@@ -779,8 +779,12 @@ Router.route("/privacy", {
     template: "privacy"
 });
 
-Router.route("/admin", {
-    template: "admin"
+Router.route("/admin", function() {
+    if (Meteor.user() !== undefined && Meteor.user().profile !== undefined && Meteor.user().profile.rank === "admin") {
+        this.render("admin");
+    } else {
+        this.redirect("/");
+    }
 });
 
 Router.route("/:type", {