{"action":"created","issue":{"url":"https://api.github.com/repos/CanCanCommunity/cancancan/issues/237","repository_url":"https://api.github.com/repos/CanCanCommunity/cancancan","labels_url":"https://api.github.com/repos/CanCanCommunity/cancancan/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/CanCanCommunity/cancancan/issues/237/comments","events_url":"https://api.github.com/repos/CanCanCommunity/cancancan/issues/237/events","html_url":"https://github.com/CanCanCommunity/cancancan/issues/237","id":99920596,"number":237,"title":"using cancancan in active admin using rails 4.2.1","user":{"login":"spurdow","id":3696283,"avatar_url":"https://avatars1.githubusercontent.com/u/3696283?v=4","gravatar_id":"","url":"https://api.github.com/users/spurdow","html_url":"https://github.com/spurdow","followers_url":"https://api.github.com/users/spurdow/followers","following_url":"https://api.github.com/users/spurdow/following{/other_user}","gists_url":"https://api.github.com/users/spurdow/gists{/gist_id}","starred_url":"https://api.github.com/users/spurdow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spurdow/subscriptions","organizations_url":"https://api.github.com/users/spurdow/orgs","repos_url":"https://api.github.com/users/spurdow/repos","events_url":"https://api.github.com/users/spurdow/events{/privacy}","received_events_url":"https://api.github.com/users/spurdow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2015-08-09T19:09:34Z","updated_at":"2017-10-16T14:48:00Z","closed_at":"2016-08-07T08:33:42Z","author_association":"NONE","body":"The problem lies with strong parameters, but i still dont get it why some solution doesnt work as stated in this blog. http://factore.ca/blog/258-rails-4-strong-parameters-and-cancan\nif you want to test the project , please feel free to fork or clone -> https://github.com/jochun/lockout-ror\n\n``` ruby\nclass Ability\n  include CanCan::Ability\n\n  def initialize(user)\n    case user.role\n      when 'user'\n        can :read, ActiveAdmin::Page, :name => \"Dashboard\"\n        can :manage, Route, :company_id => user.company_id\n        can :manage, BusRouteSchedule, :company_id => user.company_id\n        can :read, Bus , :company_id => user.company_id\n        can :manage, Conductor, :company_id => user.company_id\n        can :manage, Station, :company_id => user.company_id\n\n      when 'admin'\n        can :read, ActiveAdmin::Page, :name => \"Dashboard\"\n        can :manage, Route, :company_id => user.company_id\n        can :manage, BusRouteSchedule, :company_id => user.company_id\n        can :manage, Bus, :company_id => user.company_id\n        can :manage, Conductor, :company_id => user.company_id\n        can :manage, Station, :company_id => user.company_id\n        can :manage, AdminUser, :company_id => user.company_id\n      when 'super-admin'\n        can :manage, :all\n    end\n\n  end\nend\n```\n\nAll of the user and admin roles cant create , is there any other work around with this?\n"},"comment":{"url":"https://api.github.com/repos/CanCanCommunity/cancancan/issues/comments/336910399","html_url":"https://github.com/CanCanCommunity/cancancan/issues/237#issuecomment-336910399","issue_url":"https://api.github.com/repos/CanCanCommunity/cancancan/issues/237","id":336910399,"user":{"login":"davideghz","id":6973157,"avatar_url":"https://avatars3.githubusercontent.com/u/6973157?v=4","gravatar_id":"","url":"https://api.github.com/users/davideghz","html_url":"https://github.com/davideghz","followers_url":"https://api.github.com/users/davideghz/followers","following_url":"https://api.github.com/users/davideghz/following{/other_user}","gists_url":"https://api.github.com/users/davideghz/gists{/gist_id}","starred_url":"https://api.github.com/users/davideghz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideghz/subscriptions","organizations_url":"https://api.github.com/users/davideghz/orgs","repos_url":"https://api.github.com/users/davideghz/repos","events_url":"https://api.github.com/users/davideghz/events{/privacy}","received_events_url":"https://api.github.com/users/davideghz/received_events","type":"User","site_admin":false},"created_at":"2017-10-16T14:48:00Z","updated_at":"2017-10-16T14:48:00Z","author_association":"NONE","body":"@DuBistKomisch thhx a lot for your input; now, what about the `update` action? Also, in order to save the model, I've been forced to allow mass assignment with `without_protection: true`"}}
{"actor":{"display_login":"davideghz"}}