{"action":"created","issue":{"url":"https://api.github.com/repos/varvet/pundit/issues/547","repository_url":"https://api.github.com/repos/varvet/pundit","labels_url":"https://api.github.com/repos/varvet/pundit/issues/547/labels{/name}","comments_url":"https://api.github.com/repos/varvet/pundit/issues/547/comments","events_url":"https://api.github.com/repos/varvet/pundit/issues/547/events","html_url":"https://github.com/varvet/pundit/issues/547","id":356920774,"node_id":"MDU6SXNzdWUzNTY5MjA3NzQ=","number":547,"title":"Additional options for authorization","user":{"login":"fanantoxa","id":7717033,"node_id":"MDQ6VXNlcjc3MTcwMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/7717033?v=4","gravatar_id":"","url":"https://api.github.com/users/fanantoxa","html_url":"https://github.com/fanantoxa","followers_url":"https://api.github.com/users/fanantoxa/followers","following_url":"https://api.github.com/users/fanantoxa/following{/other_user}","gists_url":"https://api.github.com/users/fanantoxa/gists{/gist_id}","starred_url":"https://api.github.com/users/fanantoxa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanantoxa/subscriptions","organizations_url":"https://api.github.com/users/fanantoxa/orgs","repos_url":"https://api.github.com/users/fanantoxa/repos","events_url":"https://api.github.com/users/fanantoxa/events{/privacy}","received_events_url":"https://api.github.com/users/fanantoxa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-04T18:14:14Z","updated_at":"2018-09-04T19:46:09Z","closed_at":"2018-09-04T19:23:39Z","author_association":"NONE","body":"Complex authorization rules might depend on few models or some additional rules.\r\nMaybe we can update `authorization` method to allow some `options` so it can be used like:\r\n```\r\ndef publish\r\n  publisher = Publisher.find(params[:publisher_id])\r\n\r\n  @post = Post.find(params[:id])\r\n  authorize @post, options: { publisher: publisher.type }\r\n....\r\nend\r\n```\r\nor allow hash attributes pass to the policy like:\r\n```\r\nauthorize @post, publisher: publisher.type\r\n```\r\nNow modern ruby developers often use different abstractions (for example Adapters).\r\nThis update allow to write more complex authorization rules that might depend on different data.\r\n"},"comment":{"url":"https://api.github.com/repos/varvet/pundit/issues/comments/418494531","html_url":"https://github.com/varvet/pundit/issues/547#issuecomment-418494531","issue_url":"https://api.github.com/repos/varvet/pundit/issues/547","id":418494531,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODQ5NDUzMQ==","user":{"login":"Linuus","id":379823,"node_id":"MDQ6VXNlcjM3OTgyMw==","avatar_url":"https://avatars2.githubusercontent.com/u/379823?v=4","gravatar_id":"","url":"https://api.github.com/users/Linuus","html_url":"https://github.com/Linuus","followers_url":"https://api.github.com/users/Linuus/followers","following_url":"https://api.github.com/users/Linuus/following{/other_user}","gists_url":"https://api.github.com/users/Linuus/gists{/gist_id}","starred_url":"https://api.github.com/users/Linuus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Linuus/subscriptions","organizations_url":"https://api.github.com/users/Linuus/orgs","repos_url":"https://api.github.com/users/Linuus/repos","events_url":"https://api.github.com/users/Linuus/events{/privacy}","received_events_url":"https://api.github.com/users/Linuus/received_events","type":"User","site_admin":false},"created_at":"2018-09-04T19:46:09Z","updated_at":"2018-09-04T19:46:09Z","author_association":"MEMBER","body":"It’s mentioned in the readme as well. I think you should create a domain model that holds all information necessary to authorize."}}
{"actor":{"display_login":"Linuus"}}