From 3b3a30a8afda817c009f87ebb2a391cfe060b4f8 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 14 Jul 2021 23:32:46 +0000 Subject: [PATCH] --- server/AyaNova/biz/WorkOrderBiz.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/AyaNova/biz/WorkOrderBiz.cs b/server/AyaNova/biz/WorkOrderBiz.cs index 4bd9cad2..d78db7d9 100644 --- a/server/AyaNova/biz/WorkOrderBiz.cs +++ b/server/AyaNova/biz/WorkOrderBiz.cs @@ -2583,7 +2583,7 @@ namespace AyaNova.Biz return; } - if (UserIsRestrictedType && (proposedObj.UserId != UserId || currentObj.UserId != UserId)) + if (UserIsRestrictedType && (proposedObj.UserId != UserId || (!isNew && currentObj.UserId != UserId))) { //no edits allowed on other people's records AddError(ApiErrorCode.NOT_AUTHORIZED); @@ -3043,13 +3043,14 @@ namespace AyaNova.Biz } } - if (UserIsRestrictedType && (proposedObj.UserId != UserId || currentObj.UserId != UserId)) + if (UserIsRestrictedType && (proposedObj.UserId != UserId || (!isNew && currentObj.UserId != UserId))) { //no edits allowed on other people's records AddError(ApiErrorCode.NOT_AUTHORIZED); return; } + //Start date AND end date must both be null or both contain values if (proposedObj.ServiceStartDate == null && proposedObj.ServiceStopDate != null) AddError(ApiErrorCode.VALIDATION_REQUIRED, "ServiceStartDate"); @@ -5915,7 +5916,7 @@ namespace AyaNova.Biz } } - if (UserIsRestrictedType && (proposedObj.UserId != UserId || currentObj.UserId != UserId)) + if (UserIsRestrictedType && (proposedObj.UserId != UserId || (!isNew && currentObj.UserId != UserId))) { //no edits allowed on other people's records AddError(ApiErrorCode.NOT_AUTHORIZED);