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

forceUpdate-flag breaks authorization with insecure Classes. #648

Open
arggh opened this issue Oct 20, 2017 · 6 comments
Open

forceUpdate-flag breaks authorization with insecure Classes. #648

arggh opened this issue Oct 20, 2017 · 6 comments

Comments

@arggh
Copy link
Contributor

arggh commented Oct 20, 2017

When my class is not secured and I try to update a document from the client using { forceUpdate: true }, my Astronomy event-based authorization system fails (not allowing the operation when it actually should allow).

If I remove the forceUpdate-flag from the save-call, everything works as before.

Another way to "fix" it is to also apply simulation: false on the same save-operation.

Let me know if you need a repro and I'll try to come up with one.

@lukejagodzinski
Copy link
Member

Yep reproduction would be handful :)

@arggh
Copy link
Contributor Author

arggh commented Oct 21, 2017

Actually, I think these two are linked: #649

In my case where forceUpdate: true was causing issues I was also fetching only some fields of the documents (on the client), and also specifying which fields to save, like so:

doc.save({ fields: ['order'], forceUpdate: true });

I could fix the issue in three ways:

  1. Remove forceUpdate: true
  2. Remove fields attribute from the find method call, thus fetching all fields
  3. Add simulation: false to the save-call

@arggh
Copy link
Contributor Author

arggh commented Oct 21, 2017

Still working on the reproduction, but I'm missing something...

@arggh
Copy link
Contributor Author

arggh commented Oct 21, 2017

So, using forceUpdate just requires you to have all fields in the actual document object you are updating, it's not enough to have them on the client. If forceUpdate is omitted, then all you need is the field you are updating.

@lukejagodzinski
Copy link
Member

Please provide reproduction so I can easily work on a fix

@arggh
Copy link
Contributor Author

arggh commented Oct 23, 2017

I will, sorry it's taking a while, I'm in a tight spot currently with work.

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

No branches or pull requests

2 participants