This commit is contained in:
@@ -219,11 +219,21 @@ namespace AyaNova.Biz
|
||||
|
||||
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?
|
||||
|
||||
Reference in New Issue
Block a user