update tests

This commit is contained in:
Dmitriynj
2020-12-14 23:54:51 +03:00
committed by Daniel Hutzel
parent 145becb1c4
commit cb71e2ed9b
5 changed files with 340 additions and 48 deletions

View File

@@ -43,10 +43,12 @@ module.exports = async function () {
return Object.assign({}, userFromDb, { roles });
}
/**
* User can only update and read his data
*/
this.before("UPDATE", "*", async (req) => {
req.query = req.query.where({ ID: req.user.attr.ID });
});
this.before("READ", "*", async (req) => {
req.query = req.query.where({ ID: req.user.attr.ID });
});