ZF-Commons / zfc-rbac

Role-based access control module to provide additional features on top of Zend\Permissions\Rbac
BSD 3-Clause "New" or "Revised" License
181 stars 111 forks source link

Redirect to Login #96

Closed aaronweatherall closed 10 years ago

aaronweatherall commented 11 years ago

Hey team,

I'm trying to makes some modifications to ZfcRbac so that it redirects to login on a 403 error but can't seem to make it happen. I had thought that I could fire an event on

public function onBootstrap(mvcEvent $e)
    {
        $sharedEvents = $e->getApplication()->getEventManager();
        $sharedEvents->attach('ZfcRbac', 'dispatch.error', 'doStuff', 100);
    }

But this doesn't seem to work. Is there an easier solution, or could you point me towards some code to make this happen?

bakura10 commented 11 years ago

This feature is already implemented in new version of ZfcRbac (check the refactor PR).

It will be merged once ZF 2.3 is out :).

Envoyé de mon iPhone

Le 20 nov. 2013 à 01:44, Aaron Weatherall notifications@github.com a écrit :

Hey team,

I'm trying to makes some modifications to ZfcRbac so that it redirects to login on a 403 error but can't seem to make it happen. I had thought that I could fire an event on

public function onBootstrap(mvcEvent $e) { $sharedEvents = $e->getApplication()->getEventManager(); $sharedEvents->attach('ZfcRbac', 'dispatch.error', 'doStuff', 100); } But this doesn't seem to work. Is there an easier solution, or could you point me towards some code to make this happen?

— Reply to this email directly or view it on GitHub.

bakura10 commented 11 years ago

But yes as a current work around you can do that. However you don't need to register against the shared manager.

Envoyé de mon iPhone

Le 20 nov. 2013 à 01:44, Aaron Weatherall notifications@github.com a écrit :

Hey team,

I'm trying to makes some modifications to ZfcRbac so that it redirects to login on a 403 error but can't seem to make it happen. I had thought that I could fire an event on

public function onBootstrap(mvcEvent $e) { $sharedEvents = $e->getApplication()->getEventManager(); $sharedEvents->attach('ZfcRbac', 'dispatch.error', 'doStuff', 100); } But this doesn't seem to work. Is there an easier solution, or could you point me towards some code to make this happen?

— Reply to this email directly or view it on GitHub.

bakura10 commented 10 years ago

Hi,

I'm closing this now, as it will be officially supported in next version (please check the "refactor" branch).