module.exports = Self => { require('../methods/worker-dms/downloadFile')(Self); require('../methods/worker-dms/removeFile')(Self); require('../methods/worker-dms/filter')(Self); require('../methods/worker-dms/docuware')(Self); 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; }; };