publish() {
    if (Meteor.isServer) {
      // get the Collection instance.
      const instance = this;
      /** Publish only profiles marked as 'public' to all users */
      Meteor.publish(organizationPublications.orgs, function publish() {
        return instance._collection.find({ status: 'public' });
      });

      /** Publish all profiles to admin */
      Meteor.publish(organizationPublications.orgsAdmin, function publish() {
        if (this.userId && Roles.userIsInRole(this.userId, ROLE.ADMIN)) {
          return instance._collection.find();
        }
        return this.ready();
      });
    }
  }
/**
   * Default publication method for entities.
   */
Default publication method for entities.
Default publication method for entities .
publish() {
    if (Meteor.isServer) {
      const instance = this;
      Meteor.publish(organizationPublications.orgs, function publish() {
        return instance._collection.find({ status: 'public' });
      });
      Meteor.publish(organizationPublications.orgsAdmin, function publish() {
        if (this.userId && Roles.userIsInRole(this.userId, ROLE.ADMIN)) {
          return instance._collection.find();
        }
        return this.ready();
      });
    }
  }
publish ( ) { if ( Meteor . isServer ) { const instance = this ; Meteor . publish ( organizationPublications . orgs , function publish ( ) { return instance . _collection . find ( { status : 'public' } ) ; } ) ; Meteor . publish ( organizationPublications . orgsAdmin , function publish ( ) { if ( this . userId && Roles . userIsInRole ( this . userId , ROLE . ADMIN ) ) { return instance . _collection . find ( ) ; } return this . ready ( ) ; } ) ; } }
Default publication method for entities.
Default publication method for entities .
// get the Collection instance. /** Publish only profiles marked as 'public' to all users */ /** Publish all profiles to admin */