Dont attempt access checking on models without a check access method
This commit is contained in:
parent
0f4e9e1d1c
commit
4619a143f5
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue