Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Post-read hook #124

Open
rune-bk opened this issue Jun 9, 2016 · 1 comment
Open

Suggestion: Post-read hook #124

rune-bk opened this issue Jun 9, 2016 · 1 comment
Labels

Comments

@rune-bk
Copy link

rune-bk commented Jun 9, 2016

Great package! Keep up the good work!

I just have a small suggestion. Support for temporary/N-time-access files.
It can in theory be accomplished in allow-read, but only if it's the second time it's being accessed.

I'd like to return the file, then wipe the file + collection document from the system. Specifically for generated files (excel reports etc etc)

Doing so in allow-deny upon first access would delete it before it's being returned.

Can it be accomplished in some way using the custom handler?

@vsivsi vsivsi added the question label Jun 9, 2016
@vsivsi
Copy link
Owner

vsivsi commented Jun 9, 2016

You can do this by defining a custom handler for GET requests on some route.
https://github.com/vsivsi/meteor-file-collection#configuring-http-methods

You could just reuse the default code, and then add whatever removal logic you want following a successful response.
https://github.com/vsivsi/meteor-file-collection/blob/master/src/http_access_server.coffee#L135

I'm not inclined to add this type of feature to the package directly because it adds complexity and API surface to test and maintain, but based on the above, I think the flexibility is there to implement the functionality you desire in your own code without too much trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants