7658-devToTest_2428 #2663
|
@ -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