public void Update(Coords grid) { if (!ModelState.IsValid) { throw HttpExceptionFactory.InvalidModel(); } if (!userDb.CoordsAllowed(User.Identity.Name, grid) && !User.IsInRole("Admin")) { throw HttpExceptionFactory.Forbidden(); } db.UpdateCoord(grid.coords); }