Require masterKey when performing config updates
This commit is contained in:
@@ -8,6 +8,10 @@ var router = new PromiseRouter();
|
|||||||
|
|
||||||
// Returns a promise for a {response} object.
|
// Returns a promise for a {response} object.
|
||||||
function handleUpdateGlobalConfig(req) {
|
function handleUpdateGlobalConfig(req) {
|
||||||
|
if (!req.auth.isMaster) {
|
||||||
|
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, 'Config updates requires valid masterKey.');
|
||||||
|
}
|
||||||
|
|
||||||
return rest.update(req.config, req.auth,
|
return rest.update(req.config, req.auth,
|
||||||
'_GlobalConfig', 1, req.body)
|
'_GlobalConfig', 1, req.body)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user