0

I want to have app which has some default route and controller (Let's say Login page). I can register this at the Configure method but after the user successfully logs in I want to fetch the pages related to the user and register them so he can have access to it. Is there a way to achieve that?

As long as I read that's impossible but who knows, I'm new to ASP NET Core?

Expressingx
  • 1,480
  • 1
  • 14
  • 39
  • 1
    Possible duplicate of [Change route collection of MVC6 after startup](https://stackoverflow.com/questions/32565768/change-route-collection-of-mvc6-after-startup) – NightOwl888 Mar 29 '18 at 17:25

1 Answers1

0

Based on the wording, this sounds like a security question. You only want users to have access to certain pages. If that's the case then I would look at something like role-based authorization.

If the question is more about showing the user a list of resources they can access, then the most obvious solution I can think of is to store that information in a relational database. When the user logs in, select the relevant pages / resources by user ID.

In any case, changing the registered routes is not the correct approach.

Andy West
  • 12,302
  • 4
  • 34
  • 52