module.exports = function(app) { app.models.ACL.checkAccessAcl = async(ctx, modelId, property, accessType = '*') => { const models = app.models; const context = { accessToken: ctx.req.accessToken, model: models[modelId], property: property, modelId: modelId, accessType: accessType, sharedMethod: { name: property, aliases: [], sharedClass: true } }; const acl = await models.ACL.checkAccessForContext(context); return acl.permission == 'ALLOW'; }; };