{"action":"opened","issue":{"url":"https://api.github.com/repos/timbunce/WebAPI-DBIC/issues/37","labels_url":"https://api.github.com/repos/timbunce/WebAPI-DBIC/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/timbunce/WebAPI-DBIC/issues/37/comments","events_url":"https://api.github.com/repos/timbunce/WebAPI-DBIC/issues/37/events","html_url":"https://github.com/timbunce/WebAPI-DBIC/issues/37","id":57805054,"number":37,"title":"Supply routes via config","user":{"login":"ungrim97","id":2305584,"avatar_url":"https://avatars.githubusercontent.com/u/2305584?v=3","gravatar_id":"","url":"https://api.github.com/users/ungrim97","html_url":"https://github.com/ungrim97","followers_url":"https://api.github.com/users/ungrim97/followers","following_url":"https://api.github.com/users/ungrim97/following{/other_user}","gists_url":"https://api.github.com/users/ungrim97/gists{/gist_id}","starred_url":"https://api.github.com/users/ungrim97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ungrim97/subscriptions","organizations_url":"https://api.github.com/users/ungrim97/orgs","repos_url":"https://api.github.com/users/ungrim97/repos","events_url":"https://api.github.com/users/ungrim97/events{/privacy}","received_events_url":"https://api.github.com/users/ungrim97/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-16T13:37:22Z","updated_at":"2015-02-16T13:37:22Z","closed_at":null,"body":"My current use case has the following setup:\r\n\r\nMyApp::WAPID::Resource::Note;\r\nMyApp::WAPID::Resource::Notes;\r\nMyApp::Schema::Result::Note;\r\n\r\nThe Resource classes each contain a single subroutine:\r\n\r\n```perl\r\nsub forbidden {\r\n    my ($self) = @_;\r\n\r\n    my ($username, $password) = $self->request->headers->authorization_basic;\r\n\r\n   return 1 unless # some check against basic auth header;\r\n   return 0;\r\n}\r\n```\r\n\r\nThis means that the default routes don't work as they use a Generic class for all routes. Whilst I could pass in a new resource_class_for_set item this wouldn't work if I had more than one ResultSource class. \r\n\r\ncurrently in my MyApp.psgi I need to add:\r\n\r\n```perl\r\n\r\n....\r\nroutes => [\r\n    WebAPI::DBIC::Route->new(\r\n    \r\n    ),\r\n   \r\n]\r\n\r\n```"}}