Bug Fix #79 Ban '/' from serial numbers

This commit is contained in:
Gary Sharp
2016-09-29 17:47:33 +10:00
parent 669de7e46b
commit 3c521541fd
4 changed files with 20 additions and 2 deletions
@@ -69,6 +69,9 @@ namespace Disco.Services
// - Assigned User Id
// - Batch
if (d.SerialNumber.Contains("/") || d.SerialNumber.Contains(@"\"))
throw new ArgumentException(@"The device serial number cannot contain '/' or '\' characters.", nameof(d));
// Enforce Authorization
var auth = UserService.CurrentAuthorization;
if (!auth.Has(Claims.Device.Properties.AssetNumber))