Complete client side

This commit is contained in:
joker-x 2020-09-01 18:53:28 +02:00
parent 555f7a16f1
commit d6308e53d5
14 changed files with 81 additions and 8 deletions

View file

@ -120,6 +120,7 @@ async function _validateAndPreprocess(tx, entity, isCreate) {
async function create(context, entity) {
shares.enforceGlobalPermission(context, 'manageSendConfigurations');
return await knex.transaction(async tx => {
await shares.enforceEntityPermissionTx(tx, context, 'namespace', entity.namespace, 'createSendConfiguration');
@ -138,6 +139,7 @@ async function create(context, entity) {
}
async function updateWithConsistencyCheck(context, entity) {
shares.enforceGlobalPermission(context, 'manageSendConfigurations');
await knex.transaction(async tx => {
await shares.enforceEntityPermissionTx(tx, context, 'sendConfiguration', entity.id, 'edit');
@ -167,6 +169,7 @@ async function updateWithConsistencyCheck(context, entity) {
}
async function remove(context, id) {
shares.enforceGlobalPermission(context, 'manageSendConfigurations');
if (id === getSystemSendConfigurationId()) {
shares.throwPermissionDenied();
}