Meteor-CollectionFS icon indicating copy to clipboard operation
Meteor-CollectionFS copied to clipboard

DOCS: Example is broken, allow() should be for 'update' and not 'insert'

Open 0o-de-lally opened this issue 9 years ago • 11 comments

This example in the DOCS:

 Images.allow({
   'insert': function () {
      // add custom authentication code here
     return true;
      }
 });

Returns the error in browser console:

Access denied. No allow validators set on restricted collection for method 'update'. [403]

The correct example would be replacing 'insert' fro 'update' as the error suggests.

  Images.allow({
        update: function () {
         // add custom authentication code here
        return true;
        },
        insert: function () {
         // add custom authentication code here
        return true;
        }
   });

The example also generates a warning, which I could not resolve:

 The provided value 'undefined' is not a valid enum value of type XMLHttpRequestResponseType.

Lastly, the DOCS should also mention needing to install cfs:filesystem to complete this example.

0o-de-lally avatar Aug 18 '15 21:08 0o-de-lally

The example also generates a warning, which I could not resolve

same here

ameesters avatar Aug 24 '15 15:08 ameesters

Yep, me too!

serkandurusoy avatar Aug 24 '15 23:08 serkandurusoy

For the warning: https://github.com/CollectionFS/Meteor-CollectionFS/issues/688

otroboe avatar Aug 28 '15 13:08 otroboe

Thanks. I was also getting the referenced error, and this seems to have fixed things up. I still have the warning. There doesn't seem to be a fix for that yet.

mbabauer avatar Sep 21 '15 12:09 mbabauer

I am getting this too!

paulgrever avatar Sep 28 '15 23:09 paulgrever

I have the same problem

cfs:standard-packages
cfs:gridfs
yogiben:autoform-file

thearabbit avatar Oct 08 '15 10:10 thearabbit

the same

cfs:standard-packages
cfs:filesystem
yogiben:autoform-file

mikeifomin avatar Nov 17 '15 14:11 mikeifomin

Same issue here. The files are not getting uploaded!

THPubs avatar Dec 02 '15 11:12 THPubs

It looks like jpg and png works. But svg and gif does not. But inn all cases I see the console error.

THPubs avatar Dec 02 '15 11:12 THPubs

1+

cesarve77 avatar Mar 10 '16 18:03 cesarve77

This fixed my issue. Thanks lpgeiger

MarcLHauser avatar Feb 15 '18 19:02 MarcLHauser