-
Notifications
You must be signed in to change notification settings - Fork 158
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
Check dataset verbs in form endpoints #612
Comments
Great idea to separate out this issue. Some of the challenges/things to think through: Text of the 403 message Dealing with Checking auth in a less common way |
I have some questions about edge cases: Say Alice is an admin and Bob is someone who can do a lot of things except create (or update) Datasets.
Some facts about the code right now:
|
Here are my two cents!
I know the code thinks of this as updating an existing draft dataset, but I think users would think of it as creating a dataset. We don't surface the concept of draft vs. published datasets to users. For example, we don't log
If Bob can only create, then Bob should be able to create a dataset, but not add properties to it. The parallel for forms is that a user who can Right now, the /v1/projects/:id/datasets endpoint to create a dataset just seems to check the If another user (Alice) adds a property (either via the API or by publishing a form draft), Bob should be able to reference the new property. |
Once #575 is complete, Backend will have a new
dataset.create
verb that is checked in the dataset creation endpoint. With that change in place, we could start checking fordataset.create
in some cases when a form or form draft is created. We could also check fordataset.update
in form endpoints. Specifically:dataset.create
, then the request should result in a 403 error.dataset.update
, then the request should result in a 403 error.dataset.update
, then the request should result in a 403.I had been thinking that we already had an endpoint where we checked both a form verb and a dataset verb, and it looks like we do that for /v1/projects/:projectId/forms/:id/draft/dataset-diff. The comments above that endpoint seem relevant to this issue. The last sentence makes it seem like we previously decided not to check for
dataset.update
during form publish.The text was updated successfully, but these errors were encountered: