fix: prevent deleting absences for past dates #3346
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#3346
Loading…
Reference in New Issue
No description provided.
Delete Branch "hotfix-restrictAbsencePrivs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -54,2 +54,4 @@
}
}, myOptions);
const canDeleteAbsenceInPast =
await models.ACL.checkAccessAcl(ctx, 'Worker', 'canDeleteAbsenceInPast', 'WRITE');
En create ya esta codigo parecido
b14268ef1b/modules/worker/back/methods/worker/createAbsence.js (L63)
Ver si unificar
@ -65,3 +63,3 @@
if ((now.getTime() > newDate) && !canCreateAbsenceInPast)
if (!await Self.canModifyAbsenceInPast(ctx, newDate))
throw new UserError(`Holidays to past days not available`);
No acabo de ver el duplicar el UserError