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

feat: expand best practices #924

Open
wants to merge 5 commits into
base: gh-pages
Choose a base branch
from

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Apr 14, 2023

Related: #811

@dblythy dblythy requested a review from a team April 14, 2023 03:35
_includes/parse-server/best-practice.md Outdated Show resolved Hide resolved
_includes/parse-server/best-practice.md Outdated Show resolved Hide resolved
_includes/parse-server/best-practice.md Outdated Show resolved Hide resolved
@mtrezza
Copy link
Member

mtrezza commented Jul 3, 2023

Should we merge this?

@dblythy dblythy requested a review from a team July 4, 2023 02:12
@dblythy
Copy link
Member Author

dblythy commented Jul 4, 2023

It's ready for merge if you are ok!

```js
Parse.Cloud.define('updateEmail', async (req) => {
req.user.set('email', req.params.email);
await req.user.save(null, { useMasterKey: true });
Copy link
Member

@mtrezza mtrezza Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be best practice to avoid any operation using useMasterKey: true but instead give only the user write permission in the object ACL? This would mitigate the risk that through a developer mistake in code someone could execute operations because they are using the master key; instead any permission would be bound to the user's session token. Using useMasterKey: true should only be necessary if the object is locked even for the user with read/write limited to master key.

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.

2 participants