Different authorizators for front and admin

5 years ago

zimmi
Member | 95
+
0
-

Hi,
I would like to keep authorization rules for front and admin module in two separate tables. Would it be possible to consider table name when creating authorizator via config.neon?
Right now I use AuthorizatorFactory with create() method returning \Nette\Security\IAuthorizator and config.neon written like this:

authorizatorFactory: App\Model\AuthorizatorFactory
authorizator: @authorizatorFactory::create

Is it possible to do something like?

authorizatorFactory: App\Model\AuthorizatorFactory
authorizatorFront: @authorizatorFactory::create('front')
authorizatorAdmin: @authorizatorFactory::create('admin')

5 years ago

Majkl578
Moderator | 1379
+
0
-

What about similar implementation as in existing multi authenticator?

5 years ago

zimmi
Member | 95
+
0
-

Thanks for the link, I'll look into it. I was planning to use multi authenticators as well anyway, so it could be similar.