Esempio n. 1
0
        private void CheckNote(Item note)
        {
            if (!userDb.ItemAllowed(User.Identity.Name, note))
            {
                throw HttpExceptionFactory.Forbidden();
            }

            if (!ModelState.IsValid)
            {
                throw HttpExceptionFactory.InvalidModel();
            }
        }
Esempio n. 2
0
        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();
            }
        }