Ignore:
Timestamp:
08/23/24 03:03:32 (3 months ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
118e414
Parents:
57fc402
Message:

Providing access

Providing access to various functionalities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Controllers/VetCenterController.cs

    r57fc402 r72b1da2  
    3131        }
    3232
     33        /* public async Task<ActionResult> Index()
     34         {
     35
     36             var vetCenters = await db.VetCentersObj.ToListAsync();
     37             ViewBag.isAuthenticated = User.Identity.IsAuthenticated;
     38
     39             // Check if the user is an admin
     40             UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
     41             ViewBag.hasAccess = customerClass != null;
     42
     43             return View(vetCenters);
     44         }*/
    3345        public async Task<ActionResult> Index()
    3446        {
     
    3648            ViewBag.isAuthenticated = User.Identity.IsAuthenticated;
    3749
    38             // Check if the user is an admin
     50            // Проверете дали корисникот е администратор или менаџер
    3951            UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
     52               // ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
     53
    4054            ViewBag.hasAccess = customerClass != null;
    4155
    4256            return View(vetCenters);
    4357        }
     58
    4459
    4560        public async Task<ActionResult> Details(int? id)
     
    124139        }
    125140
    126         public async Task<ActionResult> Delete(int? id)
    127         {
     141        public async Task<ActionResult> Delete(int? id) {
     142             UsersClass customerClass = await checkAuthorizationAsync();
     143       
     144        ViewBag.isAuthenticated = await getCrrentUser();
     145       
    128146            if (id == null)
    129147            {
Note: See TracChangeset for help on using the changeset viewer.