Changeset d6040ef for PostgreSqlDotnetCore/Controllers/BlogController.cs
- Timestamp:
- 08/20/24 23:14:03 (3 months ago)
- Branches:
- main
- Children:
- 57fc402
- Parents:
- 63bd770
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/BlogController.cs
r63bd770 rd6040ef 11 11 { 12 12 public BlogController(UserManager<IdentityUser> userManager) : base(userManager) 13 { 13 14 { 15 14 16 } 15 17 16 18 // GET: Customer 17 public async Task<ActionResult> IndexAsync() 18 { 19 // check for permission 19 /* public async Task<ActionResult> IndexAsync() 20 { 21 // check for permission 22 bool isAuthenticated = User.Identity.IsAuthenticated; 23 if (!isAuthenticated) 24 { 25 return RedirectToAction("AccessDenied", "Error"); 26 } 27 //return View(Enumerable.Empty<UsersClass>()); 28 return View(db.BlogPostControllerObj.ToList()); 29 } 30 */ 31 32 public async Task<ActionResult> Index() 33 { 34 // Проверка за автентикација 20 35 bool isAuthenticated = User.Identity.IsAuthenticated; 36 21 37 if (!isAuthenticated) 22 38 { 23 39 return RedirectToAction("AccessDenied", "Error"); 24 40 } 25 //return View(Enumerable.Empty<UsersClass>()); 26 return View(db.BlogPostControllerObj.ToList()); 27 } 28 41 42 // Список на блог постови 43 var blogPosts = await db.BlogPostControllerObj.ToListAsync(); 44 45 // Предавање на ViewBag за проверка на автентикација 46 ViewBag.isAuthenticated = isAuthenticated; 47 48 return View(blogPosts); 49 } 29 50 // GET: Customer/Details/5 30 51 public async Task<ActionResult> DetailsAsync(int? id)
Note:
See TracChangeset
for help on using the changeset viewer.