Skip to content

What does the useMasterKey column in the _User class is useful for ? #4669

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

Closed
somq opened this issue Mar 22, 2018 · 4 comments
Closed

What does the useMasterKey column in the _User class is useful for ? #4669

somq opened this issue Mar 22, 2018 · 4 comments

Comments

@somq
Copy link

somq commented Mar 22, 2018

I know there is a limitation where a given user can't edit any other users than himself (except by using masterkey) for security reasons.

I have a case (which seems trivial in this kind of dev) where I need to edit others users while one of my users is logged in as admin. I bypassed the issue by using a cloud function and checking by-hand if the user has the right role to edit another one.

By default in the _User class there exists a useMasterKey column. I guessed that this column could eventually be set only by using the masterkey and then the user would be able to CRUD on any object and behind the hood it would use the masterkey but it seems I'm wrong.

useMasterKey column

So, could you tell me what does this column is useful for ? Is there any dev planned behind it ? Am I using it the wrong way ?

Thanks in advance for your answers.

@flovilmart
Copy link
Contributor

There's no useMasterKey column in the user table you may have created it when saving the user with

user.save({useMasterKey: true})

instead of user.save(null, {useMasterKey: true})  as per the correct usage of the API.

http://parseplatform.org/Parse-SDK-JS/api/v1.11.1/Parse.Object.html#save

@somq
Copy link
Author

somq commented Mar 22, 2018

Many thanks @flovilmart. I must be exhausted not being able to think that out by myself...
So, I'm having the right approach by using cloud function for the admin stuff ?

@flovilmart
Copy link
Contributor

You should be fine as long as you roles are tightly controled.

@somq
Copy link
Author

somq commented Mar 22, 2018

Alright, thanks again for your answer, good evening!

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

No branches or pull requests

2 participants