PoC for code sandboxing

This commit is contained in:
Daniel
2020-05-26 14:12:12 +02:00
parent 0a552b4346
commit 835f450686
7 changed files with 138 additions and 0 deletions

10
ext/srv/AdminService.js Normal file
View File

@@ -0,0 +1,10 @@
module.exports = cds.service.impl(function(){
this.before(['CREATE','UPDATE'],'Books', req => { //> ....
const book = req.data
if (book.stock < 10 && book.discount > 0.5) {
req.error('Hey, da sind so wenig übrig, die wollen wir nicht zu billig verticken')
}
})
})