문제

I am using BjyAuthorize to control access in my project.

Everything working as expected with hard coded settings in module.bjyauthorize.global.php file. But my requirement is to set users dynamically and assign their user levels dynamically.

So I want to connect this file to DB tables some how and dynamically load settings. Please someone help me to get my thing done

Thank you

도움이 되었습니까?

해결책

You have to create your own Providers or Guards that will load the settings from the database. See BjyAuthorize\Provider\Role\ZendDb or BjyAuthorize\Provider\Role\ObjectRepositoryProvider.

다른 팁

You can set settings in the Module class.

use Zend\Mvc\MvcEvent;

class Module
{
    public function onBootstrap(MvcEvent $event)
    {
        $serviceManager = $event->getApplication()->getServiceManager();
        $authorizeService = $serviceManager->get('BjyAuthorize\Service\Authorize');
        // settings
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top