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