{"action":"created","issue":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3890","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3890/labels{/name}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3890/comments","events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3890/events","html_url":"https://github.com/activeadmin/activeadmin/issues/3890","id":67789979,"number":3890,"title":"How to handle scopes or batch_actions per role and per action (index, show ...)?","user":{"login":"andywenk","id":51517,"avatar_url":"https://avatars.githubusercontent.com/u/51517?v=3","gravatar_id":"","url":"https://api.github.com/users/andywenk","html_url":"https://github.com/andywenk","followers_url":"https://api.github.com/users/andywenk/followers","following_url":"https://api.github.com/users/andywenk/following{/other_user}","gists_url":"https://api.github.com/users/andywenk/gists{/gist_id}","starred_url":"https://api.github.com/users/andywenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywenk/subscriptions","organizations_url":"https://api.github.com/users/andywenk/orgs","repos_url":"https://api.github.com/users/andywenk/repos","events_url":"https://api.github.com/users/andywenk/events{/privacy}","received_events_url":"https://api.github.com/users/andywenk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-11T14:17:10Z","updated_at":"2015-04-13T11:33:39Z","closed_at":null,"body":"Hi,\r\n\r\nwe are using the abilities in AA. So there is a role 'hotline'. This role shall not be able to see defined scopes in a registered model. The admin user is held in `current_admin_user` as usual. Now the problem:\r\n\r\nI can't reach `current_admin_user` in `ActiveAdmin::ResourceDSL` like so:\r\n\r\n    ActiveAdmin.register Player do\r\n         config.batch_actions = false\r\n         if current_admin_user.role == 'admin'\r\n           config.batch_actions = true\r\n         end\r\n         ...\r\n\r\nOn the other hand, I can't set ` config.batch_actions` in an action like `index` but I can call `current_admin_user` there. I have the same problem with scopes. \r\n\r\nWhat is the correct way to achieve this. I can't find an explanation in the docs or SO (all the examples are too high level).\r\n\r\nThanks a lot in advance!\r\n\r\nCheers\r\n\r\nAndy\r\n    "},"comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments/92321328","html_url":"https://github.com/activeadmin/activeadmin/issues/3890#issuecomment-92321328","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3890","id":92321328,"user":{"login":"andywenk","id":51517,"avatar_url":"https://avatars.githubusercontent.com/u/51517?v=3","gravatar_id":"","url":"https://api.github.com/users/andywenk","html_url":"https://github.com/andywenk","followers_url":"https://api.github.com/users/andywenk/followers","following_url":"https://api.github.com/users/andywenk/following{/other_user}","gists_url":"https://api.github.com/users/andywenk/gists{/gist_id}","starred_url":"https://api.github.com/users/andywenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andywenk/subscriptions","organizations_url":"https://api.github.com/users/andywenk/orgs","repos_url":"https://api.github.com/users/andywenk/repos","events_url":"https://api.github.com/users/andywenk/events{/privacy}","received_events_url":"https://api.github.com/users/andywenk/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T11:33:39Z","updated_at":"2015-04-13T11:33:39Z","body":"@timoschilling how about scopes then? It's the same recommendation. Would it also be the solution to allow proc's?"}}