Merge pull request #97 from strongloop/bug/check-access
Dont attempt access checking on models without a check access method
This commit is contained in:
commit
591ed86444
|
@ -164,6 +164,7 @@ app.enableAuth = function() {
|
||||||
var modelInstance = ctx.instance;
|
var modelInstance = ctx.instance;
|
||||||
var modelId = modelInstance && modelInstance.id || req.param('id');
|
var modelId = modelInstance && modelInstance.id || req.param('id');
|
||||||
|
|
||||||
|
if(Model.checkAccess) {
|
||||||
Model.checkAccess(
|
Model.checkAccess(
|
||||||
req.accessToken,
|
req.accessToken,
|
||||||
modelId,
|
modelId,
|
||||||
|
@ -181,6 +182,9 @@ app.enableAuth = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue