title: Meteor - Publish error
body: <p>I'm building an application where teachers and students interact. I trying to publish the classes for teacher/student relationship. How do I publish classes which contain the <code>teacherUserId</code> and the <code>studentUserId</code>. </p>
  
  <p>Path: <code>publish.js</code></p>
  
  <pre><code>Meteor.publish('classes', function(group){
      if (Roles.userIsInRole(this.userId, ['is_teacher'], group)) {
  
      check(id, String);
      return Classes.find({teacherUserId: this.userId, studentUserId: id});
  
      } else {
  
      // user not authorized. do not publish secrets
      this.stop();
      return;
  
      }
  });
  </code></pre>
  
  <p>Path: <code>class.js</code></p>
  
  <pre><code>Template.classes.onCreated(function() {
      var self = this;
      self.autorun(function(){
          self.subscribe('classes');
      });
  });
  
  Template.classes.helpers({
      studentProfileId: () =&gt; {
          return FlowRouter.getParam('id');
      }
  });
  </code></pre>