This commit is contained in:
Matthias Bühl
2020-01-30 17:48:32 +01:00
parent e0e330c43a
commit a458c7bb0d
5 changed files with 57 additions and 52 deletions

View File

@@ -0,0 +1,10 @@
/** Service implementation for AdminService */
module.exports = cds.service.impl(function() {
this.before ('CREATE', 'Orders', _checkOrderCreateAuth)
})
/** Check authorization */
function _checkOrderCreateAuth (req) {
req.user.currency[0] === req.data.currency_code || req.reject(403)
}