This commit is contained in:
@@ -67,7 +67,7 @@ namespace AyaNova.Biz
|
|||||||
//Create and save to db a new workorder and return it
|
//Create and save to db a new workorder and return it
|
||||||
//NOTE: Serial can be specified or edited after the fact in a limited way by full role specfic only!! (service manager, bizadminfull, accounting maybe)
|
//NOTE: Serial can be specified or edited after the fact in a limited way by full role specfic only!! (service manager, bizadminfull, accounting maybe)
|
||||||
|
|
||||||
if (serial != null && CurrentUserRoles.HasFlag(RolesAllowedToChangeSerial))
|
if (serial != null && !Authorized.HasAnyRole(CurrentUserRoles, RolesAllowedToChangeSerial))
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.NOT_AUTHORIZED, "Serial");
|
AddError(ApiErrorCode.NOT_AUTHORIZED, "Serial");
|
||||||
return null;
|
return null;
|
||||||
@@ -155,7 +155,7 @@ namespace AyaNova.Biz
|
|||||||
CopyObject.Copy(putObj, dbObj, "Id,Serial");
|
CopyObject.Copy(putObj, dbObj, "Id,Serial");
|
||||||
|
|
||||||
//if user has rights then change it, otherwise just ignore it and do the rest
|
//if user has rights then change it, otherwise just ignore it and do the rest
|
||||||
if (SnapshotOfOriginalDBObj.Serial != putObj.Serial && CurrentUserRoles.HasFlag(RolesAllowedToChangeSerial))
|
if (SnapshotOfOriginalDBObj.Serial != putObj.Serial && Authorized.HasAnyRole(CurrentUserRoles, RolesAllowedToChangeSerial))
|
||||||
{
|
{
|
||||||
dbObj.Serial = putObj.Serial;
|
dbObj.Serial = putObj.Serial;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user