This commit is contained in:
2020-12-17 21:14:54 +00:00
parent f4502c9425
commit 206f9ec423

View File

@@ -216,14 +216,24 @@ namespace AyaNova.Biz
- RULE Limited roles can only set completed date and enter completion notes not otherwise change or create or delete.
- BIZ RULE users with more than limited roles can assign other users to follow up. Limited roles can only set completed status not otherwise change or create or delete.
*/
bool isNew = currentObj == null;
bool HasSupervisorRole =
CurrentUserRoles.HasFlag(AuthorizationRoles.BizAdminFull) ||
CurrentUserRoles.HasFlag(AuthorizationRoles.DispatchFull) ||
CurrentUserRoles.HasFlag(AuthorizationRoles.InventoryFull) ||
CurrentUserRoles.HasFlag(AuthorizationRoles.SalesFull) ||
CurrentUserRoles.HasFlag(AuthorizationRoles.AccountingFull);
//Name required
if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
if(!HasSupervisorRole && proposedObj.Self){
AddError(ApiErrorCode.NOT_AUTHORIZED, "UserId");
}
//Any form customizations to validate?