committed by
Florent Vilmart
parent
673039fc5a
commit
d768211ab9
@@ -4,6 +4,9 @@ import * as middleware from '../middlewares';
|
|||||||
export class PurgeRouter extends PromiseRouter {
|
export class PurgeRouter extends PromiseRouter {
|
||||||
|
|
||||||
handlePurge(req) {
|
handlePurge(req) {
|
||||||
|
if (req.auth.isReadOnly) {
|
||||||
|
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, 'read-only masterKey isn\'t allowed to purge a schema.');
|
||||||
|
}
|
||||||
return req.config.database.purgeCollection(req.params.className)
|
return req.config.database.purgeCollection(req.params.className)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var cacheAdapter = req.config.cacheController;
|
var cacheAdapter = req.config.cacheController;
|
||||||
|
|||||||
Reference in New Issue
Block a user