示例#1
0
 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;
     }
 }
示例#2
0
 public bool HasPermission(int id)
 {
     return(checker.GridAllowed(User.Identity.Name, id));
 }