Created
March 21, 2016 11:08
-
-
Save jenkoian/e5c4d717b2cdb1d8bd97 to your computer and use it in GitHub Desktop.
PermissionUrlRequestMatcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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