rethinkdb / horizon-docs

Other
24 stars 35 forks source link

Permissions expansion #63

Open deontologician opened 8 years ago

deontologician commented 8 years ago

Right now the permissions document is a good outline, but it should probably mention some practical things like

chipotle commented 8 years ago

Are there any other bits here you know of that could be thrown in here? Adding those two to the existing document should be pretty quick, but this is a good time to expand the bullet list if other things have come up in practice.

mglukhovsky commented 8 years ago

@segphault, since you've done a lot of work with permissions recently -- what else would you like to see documented?

danielmewes commented 8 years ago

This comes to mind: https://github.com/rethinkdb/horizon-docs/issues/71 Just pinged @Tryneus for some details on the index names...

segphault commented 8 years ago

In a replace operation, there's no way to check that the ID of the document hasn't changed, because Horizon uses the ID in the provided object to fetch the document used as oldValue in the validator check. While the behavior here is totally understandable, it did lead to some slightly counterintuitive results.

In my bookmarks app, with my initial naive set of permissions, it was possible for users to take advantage of the replace operation to overwrite bookmarks that belong to other users. I had to add a validator with an oldVal.user === newVal.user check in order to prevent it.