private void CheckNote(Item note) { if (!userDb.ItemAllowed(User.Identity.Name, note)) { throw HttpExceptionFactory.Forbidden(); } if (!ModelState.IsValid) { throw HttpExceptionFactory.InvalidModel(); } }
private void CheckGridItem(Item grid) { if (!userDb.ItemAllowed(User.Identity.Name, grid)) { throw HttpExceptionFactory.Forbidden(); } if (!ModelState.IsValid) { throw HttpExceptionFactory.InvalidModel(); } if (!db.IsCorrectSlug(grid.slug, grid.id)) { throw HttpExceptionFactory.BadSlug(); } }