Skip to content

Instantly share code, notes, and snippets.

@jenkoian
Created March 21, 2016 11:08
Show Gist options
  • Save jenkoian/e5c4d717b2cdb1d8bd97 to your computer and use it in GitHub Desktop.
Save jenkoian/e5c4d717b2cdb1d8bd97 to your computer and use it in GitHub Desktop.
PermissionUrlRequestMatcher
<?php
//...
class PermissionUrlRequestMatcher implements RequestMatcherInterface
{
/**
* {@inheritdoc}
*/
public function matches(Request $request)
{
foreach (PermissionUrlMap::$permissionMap as $permission => $urlRegex) {
if (preg_match(‘{‘.$urlRegex.’}’, rawurldecode($request->getPathInfo()))) {
return true;
}
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment