ZF2 - BjyAuthorize - How to Get Rules and Guards from a Database

后端 未结 2 1745
眼角桃花
眼角桃花 2021-02-10 01:35

I\'m using BjyAuthorize with Zend Framework2 to implement authorization and was able to successfully integrate roles from database. Now I want to get my Rules and Guards also fr

2条回答
  •  無奈伤痛
    2021-02-10 02:00

    Basically you have to write your own Provider.

    Check out the different RoleProvider. Every RoleProvider implements the Provider\Role\ProviderInterface. The same thing has to be done when you want to implement Guards and Rules. You go into the specific directories Provider\Rule and Provider\Resource and check for the specific ProviderInterface.

    That way you can write your own class implementing the Interface and then via configuration you tell BjyAuthorize to use your provider-classes.

    As far as Guards are concerned, i do believe it is not yet possible to create those from Database. You would have to modify / PR the Module itself to make that happen.

提交回复
热议问题