Require masterKey when performing config updates

This commit is contained in:
Peter Theill
2016-02-07 13:51:32 +01:00
parent 6fe050b397
commit 3b0ab80965

View File

@@ -8,6 +8,10 @@ var router = new PromiseRouter();
// Returns a promise for a {response} object.
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,
'_GlobalConfig', 1, req.body)
.then((response) => {