Adds support for read-only masterKey (#4297)
* Adds support for read-only masterKey * Adds tests to make sure all endpoints are properly protected * Updates readme * nits
This commit is contained in:
@@ -25,6 +25,9 @@ import logger from './logger';
|
||||
// everything. It also knows to use triggers and special modifications
|
||||
// for the _User class.
|
||||
function RestWrite(config, auth, className, query, data, originalData, clientSDK) {
|
||||
if (auth.isReadOnly) {
|
||||
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, 'Cannot perform a write operation when using readOnlyMasterKey');
|
||||
}
|
||||
this.config = config;
|
||||
this.auth = auth;
|
||||
this.className = className;
|
||||
|
||||
Reference in New Issue
Block a user