Dont attempt access checking on models without a check access method

This commit is contained in:
Ritchie Martori 2013-12-11 19:46:56 -08:00
parent 0f4e9e1d1c
commit 4619a143f5
1 changed files with 20 additions and 16 deletions

View File

@ -164,6 +164,7 @@ app.enableAuth = function() {
var modelInstance = ctx.instance;
var modelId = modelInstance && modelInstance.id || req.param('id');
if(Model.checkAccess) {
Model.checkAccess(
req.accessToken,
modelId,
@ -181,6 +182,9 @@ app.enableAuth = function() {
}
}
);
} else {
next();
}
});
}