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

Allow modify object key without addField permission #7372

Closed
wants to merge 1 commit into from

Conversation

mstniy
Copy link
Contributor

@mstniy mstniy commented Apr 25, 2021

New Pull Request Checklist

Issue Description

Modification on nested documents currently require the addField permission.

Related issue: closes #7371

Approach

DatabaseController checks that the root field exists, so if, e.g., the field a exists, a modification on the embedded key a.b will not be considered to be creating a new field.

TODOs before merging

  • Add test cases
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK
  • ...

@ghost
Copy link

ghost commented Apr 25, 2021

Warnings
⚠️ Please add a changelog entry for your changes.

Generated by 🚫 dangerJS

@mtrezza
Copy link
Member

mtrezza commented Apr 25, 2021

Thanks for this PR!

Can you please rebase on master to make a tests pass?

@mtrezza mtrezza changed the title Do not require addField permissions unless the root field does not exist Allow add object key without addField permission Apr 25, 2021
@codecov
Copy link

codecov bot commented Apr 25, 2021

Codecov Report

Merging #7372 (e670d01) into master (3638b0e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head e670d01 differs from pull request most recent head 5a2f1e3. Consider uploading reports for the commit 5a2f1e3 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7372      +/-   ##
==========================================
- Coverage   93.91%   93.90%   -0.01%     
==========================================
  Files         181      181              
  Lines       13195    13195              
==========================================
- Hits        12392    12391       -1     
- Misses        803      804       +1     
Impacted Files Coverage Δ
src/Controllers/DatabaseController.js 93.70% <100.00%> (ø)
src/RestWrite.js 93.92% <0.00%> (-0.16%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.36% <0.00%> (-0.16%) ⬇️
src/Adapters/Files/GridFSBucketAdapter.js 80.32% <0.00%> (+0.81%) ⬆️
src/ParseServerRESTController.js 98.50% <0.00%> (+1.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3638b0e...5a2f1e3. Read the comment docs.

spec/Schema.spec.js Outdated Show resolved Hide resolved
@mtrezza mtrezza changed the title Allow add object key without addField permission Allow modify object key without addField permission Apr 25, 2021
@mtrezza
Copy link
Member

mtrezza commented Sep 3, 2021

⚠️ Important change for merging PRs from Parse Server 5.0 onwards!

We are planning to release the first beta version of Parse Server 5.0 in October 2021.

If a PR contains a breaking change and is not merged before the beta release of Parse Server 5.0, it cannot be merged until the end of 2022. Instead it has to follow the Deprecation Policy and phase-in breaking changes to be merged during the course of 2022.

One of the most voiced community feedbacks was the demand for predictability in breaking changes to make it easy to upgrade Parse Server. We have made a first step towards this by introducing the Deprecation Policy in February 2021 that assists to phase-in breaking changes, giving developers time to adapt. We will follow-up with the introduction of Release Automation and a branch model that will allow breaking changes only with a new major release, scheduled for the beginning of each calendar year.

We understand that some PRs are a long time in the making and we very much appreciate your contribution. We want to make it easy for PRs that contain a breaking change and were created before the introduction of the Deprecation Policy. These PRs can be merged with a breaking change without being phased-in before the beta release of Parse Server 5.0. We are making this exception because we appreciate that this is a time of transition that requires additional effort from contributors to adapt. We encourage everyone to prepare their PRs until the end of September and account for review time and possible adaptions.

If a PR contains a breaking change and should be merged before the beta release, please mention @parse-community/server-maintenance and we will coordinate with you to merge the PR.

Thanks for your contribution and support during this transition to Parse Server release automation!

@bdevore17
Copy link
Contributor

@mtrezza What is the status of this? It would be amazing to get this in ASAP.

@mtrezza
Copy link
Member

mtrezza commented Nov 4, 2021

@mstniy could you bring this up-to-date with the alpha branch?

@bdevore17
Copy link
Contributor

@mtrezza Would it work if I did it?

@bdevore17
Copy link
Contributor

@mtrezza I created a rebased version of this PR here #7679

@mtrezza
Copy link
Member

mtrezza commented Nov 4, 2021

@bdevore17 great, i'll take a look

@mtrezza
Copy link
Member

mtrezza commented Nov 4, 2021

Closing in favor of #7679 and thanks to @mstniy for the work and apologies for the long wait to get this reviewed.

@mtrezza mtrezza closed this Nov 4, 2021
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

Successfully merging this pull request may close these issues.

Embedded document modification requires addField permission
3 participants