Parse-sdk-js: How do you use master key?

Created on 16 Feb 2017  路  4Comments  路  Source: parse-community/Parse-SDK-JS

I want to use my master key, however none of the documentation even mentions it. How can I use it to call .save() and over-ride permissions on an object

Most helpful comment

There's a bunch of information on the master key in the security section of the documentation: http://parseplatform.github.io/docs/js/guide/#client-vs-server

To summarize:

  • Only use it on the server; distributing the master key to your client means anyone can edit your data
  • To use it, it needs to be provided at initialization: Parse.initialize(applicationKey, optionalJSKey, masterKey);
  • To use it for all requests, call Parse.Cloud.useMasterKey()
  • To use it for a single request, provide useMasterKey: true in the optional permissions object passed as the final parameter to any server call, eg: myObject.save({}, {useMasterKey: true})

All 4 comments

There's a bunch of information on the master key in the security section of the documentation: http://parseplatform.github.io/docs/js/guide/#client-vs-server

To summarize:

  • Only use it on the server; distributing the master key to your client means anyone can edit your data
  • To use it, it needs to be provided at initialization: Parse.initialize(applicationKey, optionalJSKey, masterKey);
  • To use it for all requests, call Parse.Cloud.useMasterKey()
  • To use it for a single request, provide useMasterKey: true in the optional permissions object passed as the final parameter to any server call, eg: myObject.save({}, {useMasterKey: true})

鈿狅笍 Parse.Cloud.useMasterKey() is deprecated @dylankbuckley

@jaimeagudo What should I use instead?

@giusecapo please see @andrewimm's response

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlnquere picture jlnquere  路  4Comments

Gyran picture Gyran  路  5Comments

marktyers picture marktyers  路  3Comments

myuller picture myuller  路  5Comments

adrianchifor picture adrianchifor  路  3Comments