WiP on permissions

Table of shares per user
This commit is contained in:
Tomas Bures 2017-07-27 17:11:22 +03:00
parent 89c9615592
commit 89256d62bd
20 changed files with 354 additions and 171 deletions

View file

@ -19,12 +19,10 @@ function hash(entity) {
}
async function getByIdWithTemplate(context, id) {
await shares.enforceEntityPermission(context, 'report', id, 'view');
if (context) {
await shares.enforceEntityPermission(context, 'report', id, 'view');
}
return await getByIdWithTemplateNoPerms(id);
}
async function getByIdWithTemplateNoPerms(id) {
const entity = await knex('reports')
.where('reports.id', id)
.innerJoin('report_templates', 'reports.report_template', 'report_templates.id')
@ -201,7 +199,6 @@ module.exports = {
ReportState,
hash,
getByIdWithTemplate,
getByIdWithTemplateNoPerms,
listDTAjax,
create,
updateWithConsistencyCheck,