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
Member
No description provided.
jorgep added 1 commit 2025-01-08 11:48:49 +00:00
gitea/salix/pipeline/pr-master There was a failure building this commit Details
c07e30a89c
fix: prevent deleting absences for past dates
jorgep requested review from alexm 2025-01-08 11:49:22 +00:00
jorgep added the
CR / Tests passed
label 2025-01-08 12:25:34 +00:00
jorgep added 1 commit 2025-01-08 12:52:56 +00:00
gitea/salix/pipeline/pr-master This commit looks good Details
f557b41feb
fix: tests
alexm requested changes 2025-01-08 13:02:25 +00:00
Dismissed
@ -54,2 +54,4 @@
}
}, myOptions);
const canDeleteAbsenceInPast =
await models.ACL.checkAccessAcl(ctx, 'Worker', 'canDeleteAbsenceInPast', 'WRITE');
Member

En create ya esta codigo parecido b14268ef1b/modules/worker/back/methods/worker/createAbsence.js (L63)

Ver si unificar

En create ya esta codigo parecido https://gitea.verdnatura.es/verdnatura/salix/src/commit/b14268ef1bfd0091526255e390255ad664f3839a/modules/worker/back/methods/worker/createAbsence.js#L63 Ver si unificar
jorgep marked this conversation as resolved
jorgep requested review from alexm 2025-01-08 14:47:57 +00:00
jorgep added 1 commit 2025-01-08 14:47:58 +00:00
gitea/salix/pipeline/pr-master This commit looks good Details
838617e3f6
fix: update access control for modifying absences in the past
jorgep added 2 commits 2025-01-08 17:28:05 +00:00
jorgep added 1 commit 2025-01-08 17:30:39 +00:00
gitea/salix/pipeline/pr-master There was a failure building this commit Details
50a95ed3c4
fix: correct variable name in canModifyAbsenceInPast method
alexm reviewed 2025-01-09 06:46:14 +00:00
@ -65,3 +63,3 @@
if ((now.getTime() > newDate) && !canCreateAbsenceInPast)
if (!await Self.canModifyAbsenceInPast(ctx, newDate))
throw new UserError(`Holidays to past days not available`);
Member

No acabo de ver el duplicar el UserError

No acabo de ver el duplicar el UserError
alexm approved these changes 2025-01-09 06:46:15 +00:00
alexm added 1 commit 2025-01-09 06:46:21 +00:00
gitea/salix/pipeline/pr-master This commit looks good Details
2becb20d01
Merge branch 'master' into hotfix-restrictAbsencePrivs
jorgep added 2 commits 2025-01-09 08:48:23 +00:00
jorgep merged commit bd5610afb6 into master 2025-01-09 08:53:25 +00:00
jorgep deleted branch hotfix-restrictAbsencePrivs 2025-01-09 08:53:25 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#3346
No description provided.