import Route from 'ember-route';
// import RSVP from 'rsvp';

export default Route.extend({
  model(params) {
    return this.get('store').findRecord('video-playlist', params.collection_id).then((collection) => {
      // TODO: Enable this once `owner` (User) is ID'd by it's actual ID and
      // not it's login since the Collection only has access to it's owner ID to
      // do an identity check

      // return playlist.get('owner.id').then((ownerId) => {
        // let user = this.modelFor('user');
        // if (ownerId !== user._id) {
          // return RSVP.reject('This manager does not own the specified collection');
        // }
      // });

      return collection;
    });
  }
});
