Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top