Ignore:
Timestamp:
08/23/24 15:40:14 (5 weeks 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/ErrorController.cs

    r72b1da2 r118e414  
    44    using Microsoft.AspNetCore.Identity;
    55    using Microsoft.AspNetCore.Mvc;
     6    using PostgreSqlDotnetCore.Models;
    67    using System.Threading.Tasks;
    78
     
    1718            // set if is authenticated
    1819            ViewBag.isAuthenticated = await getCrrentUser();
     20            // no access for standard user
     21            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
     22
    1923            return View();
    2024        }
     
    2428            // set if is authenticated
    2529            ViewBag.isAuthenticated = await getCrrentUser();
     30            // no access for standard user
     31            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
     32
    2633            return View();
    2734        }
Note: See TracChangeset for help on using the changeset viewer.