Suppose there is an authorization service where the application is knocked at startup, what to get the user and his rights.

So, I want to create another 1 service in which the logic of access to pages is centralized and initialized by the user, which is the result of the work of the authorization service.

How can i do this?

The simplest thing is to introduce an authorization service into the rights control service. But something seems to me that it is not entirely correct to do so ...

Can I do something else?

  • But something seems to me that it is not entirely correct to do so ... - why? - Grundy
  • But something seems to me that it is not entirely correct to do so ... - give at least arguments that confuse you? :) - overthesanity
  • @overthesanity, well, why should we transfer to a complex object and take a little bit from it, if you can transfer everything right away? - iluxa1810
  • @ iluxa1810 I do not understand: D - overthesanity

1 answer 1

In general, I did this because I didn’t want one service to know something about the existence of another series:

I created a resolver in the root resolver that requests these 2 services in the constructor.

Then the resolver requests all the necessary data from one service and sends it to another service when ready.