Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Docs claim wrong event priorities #115

Open
dkmuir opened this issue Jun 20, 2016 · 1 comment
Open

Docs claim wrong event priorities #115

dkmuir opened this issue Jun 20, 2016 · 1 comment

Comments

@dkmuir
Copy link

dkmuir commented Jun 20, 2016

The event priorities listed in the docs are not the actual priorities used in the code.
MvcRouteListener has:

public function attach(EventManagerInterface $events)
{
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authentication'], -50);
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authenticationPost'], -51);
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authorization'], -600);
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authorizationPost'], -601);
}

The docs have them listed with the priorities: 500, 499, -600, -601 respectively.

I tried fixing the code to match the docs, but then it triggers before routing happens (priority 1), so a negative priority makes sense, but is there a reason to have it as late as -50? I'm trying to use ZfcRbac together with this and it runs the guards at priority -6, so it fails those checks because it doesn't have an identity yet.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-mvc-auth; a new issue has been opened at laminas-api-tools/api-tools-mvc-auth#6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants