Share report template functionality
This commit is contained in:
parent
e6ad0e239e
commit
4822a50d0b
35 changed files with 614 additions and 128 deletions
|
@ -2,13 +2,35 @@
|
|||
|
||||
const config = require('config');
|
||||
|
||||
class ListPermission {
|
||||
|
||||
// FIXME - redo or delete
|
||||
|
||||
/*
|
||||
class ReportTemplatePermission {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
this.entityType = 'report-template';
|
||||
}
|
||||
}
|
||||
|
||||
const ReportTemplatePermissions = {
|
||||
View: new ReportTemplatePermission('view'),
|
||||
Edit: new ReportTemplatePermission('edit'),
|
||||
Delete: new ReportTemplatePermission('delete')
|
||||
};
|
||||
|
||||
|
||||
class ListPermission {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
this.entityType = 'list';
|
||||
}
|
||||
}
|
||||
|
||||
const ListPermissions = {
|
||||
View: new ListPermissions('view')
|
||||
};
|
||||
|
||||
class NamespacePermission {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
|
@ -16,10 +38,6 @@ class NamespacePermission {
|
|||
}
|
||||
}
|
||||
|
||||
const ListPermissions = {
|
||||
View: new ListPermissions('view')
|
||||
};
|
||||
|
||||
const NamespacePermissions = {
|
||||
View: new NamespacePermission('view'),
|
||||
Edit: new NamespacePermission('edit'),
|
||||
|
@ -27,7 +45,9 @@ const NamespacePermissions = {
|
|||
Delete: new NamespacePermission('delete'),
|
||||
CreateList: new NamespacePermission('create list')
|
||||
};
|
||||
*/
|
||||
|
||||
/*
|
||||
async function can(context, operation, entityId) {
|
||||
if (!context.user) {
|
||||
return false;
|
||||
|
@ -48,3 +68,8 @@ async function buildPermissions() {
|
|||
|
||||
can(ctx, ListPermissions.View, 3)
|
||||
can(ctx, NamespacePermissions.CreateList, 2)
|
||||
can(ctx, ReportTemplatePermissions.ViewReport, 5)
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue