This commit is contained in:
2021-07-14 23:32:46 +00:00
parent 946e7fc00f
commit 3b3a30a8af

View File

@@ -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);