Hey team,
We want to add extra logic when someone ‘Dissociate the relationship’ or add a new relation
We figure out that we need to override routes:
router.delete('/accounts/:recordId/relationships/features', permissionMiddlewareCreator.delete(), (request, response, next) => {
next();
});
router.post('/accounts/:recordId/relationships/features', permissionMiddlewareCreator.delete(), (request, response, next) => {
next();
});
But we get error 403
[forest] 🌳🌳🌳 'delete' access forbidden on accounts
Because we disable ‘Allow record deletion’ on both collections:
The question is how to allow or avoid permissions in the code for those 2 routes?
We want to ‘Allow record deletion’ stay disable, so no one can delete an item accidentally because Dissociate and Delete buttons are really close to each other.
Thanks and Happy New Year