-
Notifications
You must be signed in to change notification settings - Fork 218
More robust Singleton form constraint checking #6902
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
Comments
We want to prevent a user from creating data if they already have access to data. We need to do this given the constraint the only operations available to us are: search (to find what data the user has access to), create, and delete. Moreover, we can't have a transaction span multiple operations. We've discussed the possibility of always doing the following steps:
The first "search" isn't strictly necessary, but in most cases avoids performing a "delete".
At this point, thread 3 will take the user to the summary page to choose between a and b, not knowing that b will be deleted by 2. The impact is that if the user selects b, they will most likely encounter an error. However, if they are able to open the documents before it is deleted, they might be able to save it and violate the constraints we have set. This seems extremely unlikely and very difficult to exploit, but it is nonetheless a situation we need to consider. |
Extension of the current PUT API to support a search then create of search didn't return anything:
|
Possibilities for the response code if not created:
I think I prefer 409 because it indicates that the request document wasn't created (remember, we provided a document id in the path) and gives us a hint as to why it wasn't created. |
- Favor objects over traits - Avoid duplicate names - Choose more descriptive names
We'd like more robust singleton checking at the database label in order to ensure atomicity. The function would be:
Checking this requires:
This would be enabled for a REST PUT by passing a new parameter to the call.
One issue is that the persistence proxy is not transaction-aware (it doesn't have a transaction manager, and doesn't know about persistence providers are relational or not.
The simplest way might be to do this in the provider implementation:
orbeon_form_data
tableWHERE
would be for username/group permission checkingThe text was updated successfully, but these errors were encountered: