Ignore:
Timestamp:
08/20/24 16:13:49 (6 weeks ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
63bd770
Parents:
8f8226c
Message:

fix authorization

implement hiding menu items

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Controllers/ProductsController.cs

    r8f8226c r6782104  
    1616        public ProductsController(UserManager<IdentityUser> userManager) : base(userManager)
    1717        {
     18            // set if is authenticated
     19            ViewBag.isAuthenticated = new UsersClass();
    1820        }
    1921
     
    2830        public ActionResult Index(string? searchString)
    2931        {
     32            // set if is authenticated
     33            ViewBag.isAuthenticated = new UsersClass();
    3034            if (!String.IsNullOrEmpty(searchString))
    3135            {
     
    6771            // check for permission
    6872            UsersClass customerClass = await checkAuthorizationAsync();
     73            // set if is authenticated
     74            ViewBag.isAuthenticated = await getCrrentUser();
     75
    6976            if (customerClass == null)
    7077            {
     
    100107        }
    101108
    102 
    103 
    104 
    105 
    106 
    107 
    108 
    109 
    110 
    111 
    112109        // GET: Customer/Edit/5
    113110        public async Task<ActionResult> EditAsync(int? id)
     
    118115            }
    119116            UsersClass customerClass = await checkAuthorizationAsync();
     117            // set if is authenticated
     118            ViewBag.isAuthenticated = await getCrrentUser();
     119
    120120            if (customerClass == null)
    121121            {
     
    154154            }
    155155            UsersClass customerClass = await checkAuthorizationAsync();
     156            // set if is authenticated
     157            ViewBag.isAuthenticated = await getCrrentUser();
     158
    156159            if (customerClass == null)
    157160            {
Note: See TracChangeset for help on using the changeset viewer.