public Grid Get(string slug) { try { var grid = db.Get(slug); if (User.Identity.IsAuthenticated) { grid.HasPermission = userDb.GridAllowed(User.Identity.Name, grid.Id); } return(grid); } catch (Exception ex) { if (ex.Message == "Grid Not Found") { throw new HttpResponseException(HttpStatusCode.NotFound); } throw ex; } }
public bool HasPermission(int id) { return(checker.GridAllowed(User.Identity.Name, id)); }