WiP on permissions
Table of shares per user
This commit is contained in:
parent
89c9615592
commit
89256d62bd
20 changed files with 354 additions and 171 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue