Skip to content

Commit 3253c22

Browse files
author
Johnlee
committed
fix purge bug (parse-community#4619)
1 parent 673039f commit 3253c22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Routers/PurgeRouter.js

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import * as middleware from '../middlewares';
44
export class PurgeRouter extends PromiseRouter {
55

66
handlePurge(req) {
7+
if (req.auth.isReadOnly) {
8+
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, 'read-only masterKey isn\'t allowed to create a schema.');
9+
}
710
return req.config.database.purgeCollection(req.params.className)
811
.then(() => {
912
var cacheAdapter = req.config.cacheController;

0 commit comments

Comments
 (0)