Skip to content

Commit

Permalink
Added required permission for posting to rasa parse.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdh committed Nov 11, 2018
1 parent eb19952 commit 9ee8149
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/authentication/guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function hasCustomPermission(req, permissions) {
`${req.params.talkWrapper}:${req.method === 'GET' ? 'read' : 'write'}`,
);
} else if (req.params.agent) {
if (req.route.path === '/training/parse/:agent') {
return _.includes(permissions, `${req.params.agent}:read`);
}
return _.includes(
permissions,
`${req.params.agent}:${req.method === 'GET' ? 'read' : 'write'}`,
Expand Down

0 comments on commit 9ee8149

Please sign in to comment.