Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace User\Acl;
- use Zend\ServiceManager\FactoryInterface;
- use Zend\ServiceManager\ServiceLocatorInterface;
- class ServiceFactory implements FactoryInterface
- {
- public function createService(ServiceLocatorInterface $serviceLocator)
- {
- $config = $serviceLocator->get('Config');
- $cache = $serviceLocator->get('Application\Cache\Objects');
- $auth = $serviceLocator->get('User\Authentication\Service');
- $role = $auth->hasIdentity() ? $auth->getIdentity()->getGroup() : 'guest';
- $acl = new Service($role, $config['acl'], $cache);
- return $acl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement