salix/modules/worker/back/models/worker-dms.js

18 lines
554 B
JavaScript
Raw Normal View History

2019-11-22 09:42:05 +00:00
module.exports = Self => {
2020-04-03 15:52:47 +00:00
require('../methods/worker-dms/downloadFile')(Self);
2019-11-22 09:42:05 +00:00
require('../methods/worker-dms/removeFile')(Self);
2020-04-03 15:52:47 +00:00
require('../methods/worker-dms/filter')(Self);
2023-07-03 13:05:39 +00:00
require('../methods/worker-dms/docuwareDownload')(Self);
2020-04-03 15:52:47 +00:00
Self.isMine = async function(ctx, dmsId) {
const myUserId = ctx.req.accessToken.userId;
let workerDms = await Self.findOne({
where: {
workerFk: myUserId,
dmsFk: dmsId
}
});
return workerDms !== null;
};
2019-11-22 09:42:05 +00:00
};