feat: solo puede dar conforme/no confome el propio usuario

This commit is contained in:
Vicent Llopis 2023-02-23 14:33:16 +01:00
parent 9310e92223
commit 475bc2c255
1 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,10 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
const isHimself = userId == args.workerId;
if (!isHimself)
throw new UserError(`You don't have enough privileges`);
const workerTimeControlMail = await models.WorkerTimeControlMail.findOne({
where: {
workerFk: args.workerId,