fix: Apply permlevel for update_doc endpoint in v2 API #32135
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apply Read Permission to returned fields of API v2
Bug Fix for: #32045
With this change, the API v2 now checks which fields the user is allowed to see when updating documents. In comparison to the "read_doc" method, the call to "apply_fieldlevel_read_permissions" did not yet exist when saving.
The document function “save” only checks whether the permissions for write and save are available. When the document is returned, however, no check is made at any point as to which fields the user is actually permitted to read.
With "Read_doc", the permission check is carried out in the API and fields are then checked directly.