This commit is contained in:
parent
93f2995d39
commit
1f6fd8d6d1
|
@ -35,8 +35,10 @@ module.exports = Self => {
|
||||||
|
|
||||||
const yearNumber = dated.getFullYear();
|
const yearNumber = dated.getFullYear();
|
||||||
const weekNumber = moment(dated).isoWeek();
|
const weekNumber = moment(dated).isoWeek();
|
||||||
|
const isSubordinate = await models.Worker.isSubordinate(ctx, workerId, myOptions);
|
||||||
|
const isTeamBoss = await models.ACL.checkAccessAcl(ctx, 'Worker', 'isTeamBoss', 'WRITE');
|
||||||
|
|
||||||
if (!await models.Worker.isSubordinate(ctx, workerId) || workerId === ctx.req.accessToken.userId)
|
if (!isSubordinate || (workerId === ctx.req.accessToken.userId && !isTeamBoss))
|
||||||
throw new UserError(`You don't have enough privileges`);
|
throw new UserError(`You don't have enough privileges`);
|
||||||
|
|
||||||
const workerTimeControlMail = await models.WorkerTimeControlMail.findOne({
|
const workerTimeControlMail = await models.WorkerTimeControlMail.findOne({
|
||||||
|
|
Loading…
Reference in New Issue