|
@@ -38,3 +38,17 @@ Router.route('/submit', {
|
|
|
Router.onBeforeAction('dataNotFound', {
|
|
|
only: 'postPage'
|
|
|
});
|
|
|
+
|
|
|
+var requireLogin = function () {
|
|
|
+ if (!Meteor.user()) {
|
|
|
+ this.render('accessDenied');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.next();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// Appliquer le contrôle d'accès à la route postSubmit.
|
|
|
+Router.onBeforeAction(requireLogin, {
|
|
|
+ only: 'postSubmit'
|
|
|
+});
|