Ignore:
Timestamp:
08/22/24 01:46:17 (3 months ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
72b1da2
Parents:
d6040ef
Message:

Аsync, access permission, and other fixes.

Regulation of access permissions. Which fields can be accessed by different users.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Controllers/PetCaresController.cs

    rd6040ef r57fc402  
    7878
    7979        // GET: Customer/Details/5
    80         public ActionResult Details(int? id)
     80        public async Task<ActionResult> Details(int? id)
    8181        {
    8282            if (id == null)
     
    8484                return RedirectToAction("NotExist", "Error");
    8585            }
     86            UsersClass customerClass = await getCrrentUser();
     87            ViewBag.isAuthenticated = customerClass;
    8688            Pet_CaresClass peClass = db.PetCaresObj.Find(id);
    8789            if (peClass == null)
     
    178180            var vetCenters = await db.VetCentersObj.ToListAsync();
    179181            ViewBag.VetCenters = new SelectList(vetCenters, "id", "name", peClass.vetcentersid);
    180 
     182            // dodadeno na 22.08
     183            ViewBag.isAuthenticated = await getCrrentUser();
    181184            return View(peClass);
    182185        }
     
    196199                return RedirectToAction("AccessDenied", "Error");
    197200            }
     201            ViewBag.isAuthenticated = await getCrrentUser();
    198202
    199203            if (ModelState.IsValid)
     
    214218
    215219        // GET: Customer/Delete/5
    216         public ActionResult Delete(int? id)
     220        public async Task<ActionResult> Delete(int? id)
    217221        {
    218222            if (id == null)
     
    220224                return RedirectToAction("NotExist", "Error");
    221225            }
     226            UsersClass customerClass = await getCrrentUser(); // Добијте ја тековната улога на корисникот
     227            ViewBag.isAuthenticated = customerClass;
    222228            Pet_CaresClass peClass = db.PetCaresObj.Find(id);
    223229            if (peClass == null)
Note: See TracChangeset for help on using the changeset viewer.