{"action":"opened","issue":{"url":"https://api.github.com/repos/reactjs/react-router/issues/3501","repository_url":"https://api.github.com/repos/reactjs/react-router","labels_url":"https://api.github.com/repos/reactjs/react-router/issues/3501/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-router/issues/3501/comments","events_url":"https://api.github.com/repos/reactjs/react-router/issues/3501/events","html_url":"https://github.com/reactjs/react-router/issues/3501","id":157582383,"number":3501,"title":"export matchPattern utility for end users","user":{"login":"andrewmclagan","id":1073259,"avatar_url":"https://avatars.githubusercontent.com/u/1073259?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewmclagan","html_url":"https://github.com/andrewmclagan","followers_url":"https://api.github.com/users/andrewmclagan/followers","following_url":"https://api.github.com/users/andrewmclagan/following{/other_user}","gists_url":"https://api.github.com/users/andrewmclagan/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewmclagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewmclagan/subscriptions","organizations_url":"https://api.github.com/users/andrewmclagan/orgs","repos_url":"https://api.github.com/users/andrewmclagan/repos","events_url":"https://api.github.com/users/andrewmclagan/events{/privacy}","received_events_url":"https://api.github.com/users/andrewmclagan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-31T03:19:51Z","updated_at":"2016-05-31T03:19:51Z","closed_at":null,"body":"We should be exporting the `matchPattern` utility for end users:\r\n\r\n**Use case**\r\n\r\nMatching route within authorization functions:\r\n\r\n````\r\nfunction canAccessRoute(user, currentRoute) {\r\n    const deny = ['/admin/*', '/statistics/*','/secret/*'];\r\n  \r\n    if (! user.isAdmin()) {\r\n        return deny.reduce(route => matchPattern(route, currentRoute));\r\n    }\r\n    return true;\r\n}\r\n````\r\n\r\npseudo code obviously..."}}
{"actor":{"display_login":"andrewmclagan"}}