{"action":"opened","issue":{"url":"https://api.github.com/repos/YaleSTC/reservations/issues/1391","labels_url":"https://api.github.com/repos/YaleSTC/reservations/issues/1391/labels{/name}","comments_url":"https://api.github.com/repos/YaleSTC/reservations/issues/1391/comments","events_url":"https://api.github.com/repos/YaleSTC/reservations/issues/1391/events","html_url":"https://github.com/YaleSTC/reservations/issues/1391","id":123593431,"number":1391,"title":"ability.rb is fundamentally (kinda) broken","user":{"login":"orenyk","id":901808,"avatar_url":"https://avatars.githubusercontent.com/u/901808?v=3","gravatar_id":"","url":"https://api.github.com/users/orenyk","html_url":"https://github.com/orenyk","followers_url":"https://api.github.com/users/orenyk/followers","following_url":"https://api.github.com/users/orenyk/following{/other_user}","gists_url":"https://api.github.com/users/orenyk/gists{/gist_id}","starred_url":"https://api.github.com/users/orenyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orenyk/subscriptions","organizations_url":"https://api.github.com/users/orenyk/orgs","repos_url":"https://api.github.com/users/orenyk/repos","events_url":"https://api.github.com/users/orenyk/events{/privacy}","received_events_url":"https://api.github.com/users/orenyk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/YaleSTC/reservations/labels/diff:%202","name":"diff: 2","color":"ffffbb"},{"url":"https://api.github.com/repos/YaleSTC/reservations/labels/pri:%203","name":"pri: 3","color":"ff6060"},{"url":"https://api.github.com/repos/YaleSTC/reservations/labels/type:%20enhancement","name":"type: enhancement","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/YaleSTC/reservations/milestones/37","html_url":"https://github.com/YaleSTC/reservations/milestones/6.0.0","labels_url":"https://api.github.com/repos/YaleSTC/reservations/milestones/37/labels","id":1400721,"number":37,"title":"6.0.0","description":"Final sprint of Fall 2015. Major release including Rails / Ruby update and background task setup.","creator":{"login":"orenyk","id":901808,"avatar_url":"https://avatars.githubusercontent.com/u/901808?v=3","gravatar_id":"","url":"https://api.github.com/users/orenyk","html_url":"https://github.com/orenyk","followers_url":"https://api.github.com/users/orenyk/followers","following_url":"https://api.github.com/users/orenyk/following{/other_user}","gists_url":"https://api.github.com/users/orenyk/gists{/gist_id}","starred_url":"https://api.github.com/users/orenyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orenyk/subscriptions","organizations_url":"https://api.github.com/users/orenyk/orgs","repos_url":"https://api.github.com/users/orenyk/repos","events_url":"https://api.github.com/users/orenyk/events{/privacy}","received_events_url":"https://api.github.com/users/orenyk/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":0,"state":"open","created_at":"2015-11-09T04:00:00Z","updated_at":"2015-12-23T02:40:22Z","due_on":"2016-02-01T05:00:00Z","closed_at":null},"comments":0,"created_at":"2015-12-23T02:40:22Z","updated_at":"2015-12-23T02:40:22Z","closed_at":null,"body":"So, while reviewing #1350 we ran into an issue where we needed seemingly duplicate statements in `ability.rb` to handle checkout person authorization despite the fact that it *appeared* as it should be definable in just one `when` block. Unfortunately, due to the way Ruby `case` statements work, we're never actually getting into that when block for checkout persons. Fortunately, all of the abilities in that block are subsets of abilities in the matching checkout person block, so we haven't ever noticed this fact.\r\n\r\nWe should refactor `ability.rb` to properly handle role inheritance ([this](https://github.com/CanCanCommunity/cancancan/wiki/Role-Based-Authorization#alternative-role-inheritance) seems like a good setup) so that everything is cleaner and makes more sense."}}