Ignore:
Timestamp:
08/23/24 15:40:14 (2 months ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
e9bb9d1
Parents:
72b1da2
Message:

fix access

implement multiple access pages with different roles
optimize present three structure of BlogPost and Answer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Controllers/HomeController.cs

    r72b1da2 r118e414  
    5959                    // set if is authenticated
    6060                    ViewBag.isAuthenticated = await getCrrentUser();
     61                    // проба на 23.08
     62                    // no access for standard user
     63                    ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
     64
    6165                }
    6266
     
    7579            // set if is authenticated
    7680            ViewBag.isAuthenticated = await getCrrentUser();
     81            // no access for standard user
     82            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
     83
    7784            return View();
    7885        }
     
    8188            // set if is authenticated
    8289            ViewBag.isAuthenticated = await getCrrentUser();
     90            // no access for standard user
     91            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
     92
    8393            return View();
    8494        }
Note: See TracChangeset for help on using the changeset viewer.