{"action":"created","issue":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/5374","repository_url":"https://api.github.com/repos/activeadmin/activeadmin","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/5374/labels{/name}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/5374/comments","events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/5374/events","html_url":"https://github.com/activeadmin/activeadmin/issues/5374","id":304289127,"number":5374,"title":" How can I separate actions Depending on user's status?","user":{"login":"yuji-for-co","id":34509273,"avatar_url":"https://avatars0.githubusercontent.com/u/34509273?v=4","gravatar_id":"","url":"https://api.github.com/users/yuji-for-co","html_url":"https://github.com/yuji-for-co","followers_url":"https://api.github.com/users/yuji-for-co/followers","following_url":"https://api.github.com/users/yuji-for-co/following{/other_user}","gists_url":"https://api.github.com/users/yuji-for-co/gists{/gist_id}","starred_url":"https://api.github.com/users/yuji-for-co/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuji-for-co/subscriptions","organizations_url":"https://api.github.com/users/yuji-for-co/orgs","repos_url":"https://api.github.com/users/yuji-for-co/repos","events_url":"https://api.github.com/users/yuji-for-co/events{/privacy}","received_events_url":"https://api.github.com/users/yuji-for-co/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-12T09:10:08Z","updated_at":"2018-03-18T11:58:22Z","closed_at":"2018-03-18T11:58:22Z","author_association":"NONE","body":"I want separate actions Depending on user's status, but I dont know how.\r\nI already tried below.\r\n\r\n```\r\nActiveAdmin.register User do\r\n  disable_actions = [ :new, :create, :edit, :update]\r\n  # this if statement doesn't work...\r\n  disable_actions.push(:destroy) if proc {current_user.role == 'admin'}\r\n  actions :all, except: disable_actions\r\n```\r\nthese also doesn't work. \r\n```\r\nActiveAdmin.register User do\r\n  controller do \r\n    disable_actions = [ :new, :create, :edit, :update]\r\n    # this if statement doesn't work...\r\n    disable_actions.push(:destroy) if proc {current_user.role == 'admin'}\r\n    actions :all, except: disable_actions\r\n  end\r\n\r\n  or \r\n\r\n  actions :index if proc{current_user.role == 'admin'}\r\n  actions :index, :show if proc{current_user.role == 'staff'}\r\nend\r\n```\r\n\r\nAlso I read this issue. When talking about this issue, active admin didn't support this issue.\r\nDoes active admin correspond to this function in this version?\r\nhttps://github.com/activeadmin/activeadmin/issues/341"},"comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments/373992663","html_url":"https://github.com/activeadmin/activeadmin/issues/5374#issuecomment-373992663","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/5374","id":373992663,"user":{"login":"yuji-for-co","id":34509273,"avatar_url":"https://avatars0.githubusercontent.com/u/34509273?v=4","gravatar_id":"","url":"https://api.github.com/users/yuji-for-co","html_url":"https://github.com/yuji-for-co","followers_url":"https://api.github.com/users/yuji-for-co/followers","following_url":"https://api.github.com/users/yuji-for-co/following{/other_user}","gists_url":"https://api.github.com/users/yuji-for-co/gists{/gist_id}","starred_url":"https://api.github.com/users/yuji-for-co/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuji-for-co/subscriptions","organizations_url":"https://api.github.com/users/yuji-for-co/orgs","repos_url":"https://api.github.com/users/yuji-for-co/repos","events_url":"https://api.github.com/users/yuji-for-co/events{/privacy}","received_events_url":"https://api.github.com/users/yuji-for-co/received_events","type":"User","site_admin":false},"created_at":"2018-03-18T11:58:22Z","updated_at":"2018-03-18T11:58:22Z","author_association":"NONE","body":"I can do this by using before_action. thank you!"}}
{"actor":{"display_login":"yuji-for-co"}}