parse-community / parse-community/parse-server

log the field that was the added during validatingPermission

Open
#8,664 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Feature / Enhancement Checklist
Current Limitation

Currently, when there's a newly added field to an object, we validate for permission if it can be added

if (newKeys.length > 0) {
      // adds a marker that new field is being adding during update
      runOptions.addsField = true;
      const action = runOptions.action;
      return schema.validatePermission(className, aclGroup, 'addField', action);
 }

validatePermission can throw an error depending on whether the field can be added or not.
Actual Error :- ParseError: Permission denied for action addField on class _User.
I think would be better to log the newly added field if in case validatePermission throws error

Feature / Enhancement Description

Log the newly added field if the validation fields, as it provides better information on what went wrong.
Expected Error :- ParseError: Permission denied for action addField on class -User.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shown update path where newKeys are detected and validatePermission is called for the addField action; trace how the newly added field and permission error are represented. Done means a denied addField validation reports the relevant field in the error, with behavior confirmed by the existing permission-validation tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
authorization, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.