コード例 #1
0
ファイル: GridController.cs プロジェクト: Suhoy95/fractalApi
 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));
 }