Subscription/unsubscription seems to work.
This commit is contained in:
parent
d8ee364a4b
commit
e9165838dc
22 changed files with 14939 additions and 196 deletions
|
@ -33,21 +33,22 @@ async function listDTAjax(context, params) {
|
|||
}
|
||||
|
||||
async function _getByIdTx(tx, context, id) {
|
||||
shares.enforceEntityPermissionTx(tx, context, 'list', id, 'view');
|
||||
await shares.enforceEntityPermissionTx(tx, context, 'list', id, 'view');
|
||||
const entity = await tx('lists').where('id', id).first();
|
||||
entity.permissions = await shares.getPermissionsTx(tx, context, 'list', id);
|
||||
return entity;
|
||||
}
|
||||
|
||||
async function getById(context, id) {
|
||||
return await knex.transaction(async tx => {
|
||||
return _getByIdTx(tx, context, id);
|
||||
// note that permissions are not obtained here as this methods is used only with synthetic admin context
|
||||
return await _getByIdTx(tx, context, id);
|
||||
});
|
||||
}
|
||||
|
||||
async function getByIdWithListFields(context, id) {
|
||||
return await knex.transaction(async tx => {
|
||||
const entity = _getByIdTx(tx, context, id);
|
||||
const entity = await _getByIdTx(tx, context, id);
|
||||
entity.permissions = await shares.getPermissionsTx(tx, context, 'list', id);
|
||||
entity.listFields = await fields.listByOrderListTx(tx, id);
|
||||
return entity;
|
||||
});
|
||||
|
@ -60,8 +61,7 @@ async function getByCid(context, cid) {
|
|||
shares.throwPermissionDenied();
|
||||
}
|
||||
|
||||
shares.enforceEntityPermissionTx(tx, context, 'list', entity.id, 'view');
|
||||
entity.permissions = await shares.getPermissionsTx(tx, context, 'list', entity.id);
|
||||
await shares.enforceEntityPermissionTx(tx, context, 'list', entity.id, 'view');
|
||||
return entity;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue