Disables find on installation from clients

- fixes #1372
This commit is contained in:
Florent Vilmart
2016-04-05 13:09:40 -04:00
parent 406f237119
commit 5773143973
2 changed files with 49 additions and 5 deletions

View File

@@ -119,11 +119,11 @@ function update(config, auth, className, objectId, restObject) {
// Disallowing access to the _Role collection except by master key
function enforceRoleSecurity(method, className, auth) {
if (method === 'delete' && className === '_Installation' && !auth.isMaster) {
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN,
'Clients aren\'t allowed to perform the ' +
'delete operation on the installation collection.');
if (className === '_Installation' && !auth.isMaster) {
if (method === 'delete' || method === 'find') {
let error = `Clients aren't allowed to perform the ${method} operation on the installation collection.`
throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, error);
}
}
}