fix: prevent deleting absences for past dates #3346

Merged
jorgep merged 9 commits from hotfix-restrictAbsencePrivs into master 2025-01-09 08:53:25 +00:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 50a95ed3c4 - Show all commits

View File

@ -28,9 +28,9 @@ module.exports = Self => {
Self.canModifyAbsenceInPast = async(ctx, time) => {
const hasPrivs = await Self.app.models.ACL.checkAccessAcl(ctx, 'Worker', 'canModifyAbsenceInPast', 'WRITE');
const now = Date.vnNew();
now.setHours(0, 0, 0, 0);
return hasPrivs || now.getTime() < time;
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
return hasPrivs || today.getTime() < time;
};
async function tinIsValid(err, done) {