CulturalMe / meteor-slingshot

Upload files directly to AWS S3, Google Cloud Storage and others in meteor
MIT License
595 stars 104 forks source link

createDirective bucket accepts only strings #219

Open davidalekna opened 7 years ago

davidalekna commented 7 years ago

Hello, thanks for great package! I have this situation where I need to access this.userId while declaring bucket, but bucket accepts strings only. Any suggestions how could I access user?

I'm seeking for the following behaviour.

  Slingshot.createDirective('directive', Slingshot.GoogleCloud, {
        bucket: () => Meteor.users.findOne(this.userId).companyId;
        acl: "public-read",
        authorize: () => {},
        key: (file, metaContext) => {}
  );

Thanks!