From df6db12336bb9445858cdd775c4eade708d499c3 Mon Sep 17 00:00:00 2001 From: robertoooc Date: Tue, 12 Mar 2024 22:01:47 -0700 Subject: [PATCH] fixes logic to push to the edit time entry history --- src/controllers/timeEntryController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/timeEntryController.js b/src/controllers/timeEntryController.js index b99fe3bd4..025fac637 100644 --- a/src/controllers/timeEntryController.js +++ b/src/controllers/timeEntryController.js @@ -254,7 +254,8 @@ const timeEntrycontroller = function (TimeEntry) { && timeEntry.totalSeconds !== newTotalSeconds && timeEntry.isTangible && isForAuthUser - && !(await hasPermission(req.body.requestor, 'editTimeEntry')) + && (await hasPermission(req.body.requestor, 'editTimeEntry')) + && (req.body.requestor.role !== 'Owner' && req.body.requestor.role !== 'Administrator') ) { const requestor = await UserProfile.findById( req.body.requestor.requestorId,