{"action":"created","issue":{"url":"https://api.github.com/repos/elabs/pundit/issues/226","labels_url":"https://api.github.com/repos/elabs/pundit/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/elabs/pundit/issues/226/comments","events_url":"https://api.github.com/repos/elabs/pundit/issues/226/events","html_url":"https://github.com/elabs/pundit/issues/226","id":47801728,"number":226,"title":"Make authorize a module method","user":{"login":"scottjacobsen","id":86936,"avatar_url":"https://avatars.githubusercontent.com/u/86936?v=3","gravatar_id":"","url":"https://api.github.com/users/scottjacobsen","html_url":"https://github.com/scottjacobsen","followers_url":"https://api.github.com/users/scottjacobsen/followers","following_url":"https://api.github.com/users/scottjacobsen/following{/other_user}","gists_url":"https://api.github.com/users/scottjacobsen/gists{/gist_id}","starred_url":"https://api.github.com/users/scottjacobsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottjacobsen/subscriptions","organizations_url":"https://api.github.com/users/scottjacobsen/orgs","repos_url":"https://api.github.com/users/scottjacobsen/repos","events_url":"https://api.github.com/users/scottjacobsen/events{/privacy}","received_events_url":"https://api.github.com/users/scottjacobsen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-11-05T05:42:03Z","updated_at":"2015-02-20T03:19:40Z","closed_at":null,"body":"I've run into cases where it would be nice to use the `authorize` method outside a controller. It would be handy to be able to do `Pundit.authorize(user, record, :edit?)` where that method would raise `Pundit::NotAuthorizedError` if the action is not authorized.\r\n\r\nIt seems like it would be a simple matter of making the current `authorize` method a module method that takes three arguments - `user, record, query`, and making the current `authorize` instance method delegate to that method.\r\n\r\nI would be happy to submit a PR if that sounds like it is worth doing."},"comment":{"url":"https://api.github.com/repos/elabs/pundit/issues/comments/75183700","html_url":"https://github.com/elabs/pundit/issues/226#issuecomment-75183700","issue_url":"https://api.github.com/repos/elabs/pundit/issues/226","id":75183700,"user":{"login":"scottjacobsen","id":86936,"avatar_url":"https://avatars.githubusercontent.com/u/86936?v=3","gravatar_id":"","url":"https://api.github.com/users/scottjacobsen","html_url":"https://github.com/scottjacobsen","followers_url":"https://api.github.com/users/scottjacobsen/followers","following_url":"https://api.github.com/users/scottjacobsen/following{/other_user}","gists_url":"https://api.github.com/users/scottjacobsen/gists{/gist_id}","starred_url":"https://api.github.com/users/scottjacobsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottjacobsen/subscriptions","organizations_url":"https://api.github.com/users/scottjacobsen/orgs","repos_url":"https://api.github.com/users/scottjacobsen/repos","events_url":"https://api.github.com/users/scottjacobsen/events{/privacy}","received_events_url":"https://api.github.com/users/scottjacobsen/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T03:19:40Z","updated_at":"2015-02-20T03:19:40Z","body":"As far as I know my PR is ready to go."}}