import RestController from 'stein-orm-rest'
const customAuthorization = (req, res, next) => {
if (!req.user.canAccessTask(req)) {
return res.status(401).send('you cannot access this task')
}
return next()
};
new RestController(app, {
auth: [customAuthorization],
modelType: Task,
route: '/tasks',
})
stein-orm-rest
11.4.4 • Public • PublishedReadme
Keywords
nonePackage Sidebar
Install
npm i stein-orm-rest
Weekly Downloads
34
Version
11.4.4
License
MIT
Unpacked Size
195 kB
Total Files
30