{"action":"created","issue":{"url":"https://api.github.com/repos/mautic/mautic/issues/6917","repository_url":"https://api.github.com/repos/mautic/mautic","labels_url":"https://api.github.com/repos/mautic/mautic/issues/6917/labels{/name}","comments_url":"https://api.github.com/repos/mautic/mautic/issues/6917/comments","events_url":"https://api.github.com/repos/mautic/mautic/issues/6917/events","html_url":"https://github.com/mautic/mautic/issues/6917","id":383492810,"node_id":"MDU6SXNzdWUzODM0OTI4MTA=","number":6917,"title":"Users see checkboxes and dropdown arrow in lists even though they can't do anything with them..","user":{"login":"srdecny","id":7964806,"node_id":"MDQ6VXNlcjc5NjQ4MDY=","avatar_url":"https://avatars1.githubusercontent.com/u/7964806?v=4","gravatar_id":"","url":"https://api.github.com/users/srdecny","html_url":"https://github.com/srdecny","followers_url":"https://api.github.com/users/srdecny/followers","following_url":"https://api.github.com/users/srdecny/following{/other_user}","gists_url":"https://api.github.com/users/srdecny/gists{/gist_id}","starred_url":"https://api.github.com/users/srdecny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srdecny/subscriptions","organizations_url":"https://api.github.com/users/srdecny/orgs","repos_url":"https://api.github.com/users/srdecny/repos","events_url":"https://api.github.com/users/srdecny/events{/privacy}","received_events_url":"https://api.github.com/users/srdecny/received_events","type":"User","site_admin":false},"labels":[{"id":154414515,"node_id":"MDU6TGFiZWwxNTQ0MTQ1MTU=","url":"https://api.github.com/repos/mautic/mautic/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-11-22T11:24:45Z","updated_at":"2018-11-29T15:57:10Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Bug Description\r\nUsers with insufficient permissions can still see the mass action checkbox and dropdown menu, even though they can't do anything with them. See attached image for illustration.\r\n![example](https://user-images.githubusercontent.com/7964806/48899989-6b9ccd00-ee51-11e8-9574-b2d639104106.gif)\r\n\r\n\r\n| Q   | A\r\n| --- | ---\r\n| Mautic version | 2.14.2 (but issue shows up on staging too)\r\n| PHP version | \r\n| Browser | \r\n\r\n### Steps to reproduce\r\n1. Create a new user account with Campaign permissions set to View own/others only.\r\n2. Create a new campaign.\r\n3. Log in with the new user account.\r\n4. The checkbox for mass actions and dropdown arrow still shows up, even though the avaliable actions are empty.\r\n\r\nThis bug also shows up for practically every Mautic item, such as Contacts, Marketing Messages.\r\n\r\nIn case this issue turns out to be a bug and not an intended behaviour, I'm actively interested in fixing it and creating a PR eventually. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mautic/mautic/issues/comments/442886365","html_url":"https://github.com/mautic/mautic/issues/6917#issuecomment-442886365","issue_url":"https://api.github.com/repos/mautic/mautic/issues/6917","id":442886365,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mjg4NjM2NQ==","user":{"login":"cyanstar","id":10960390,"node_id":"MDQ6VXNlcjEwOTYwMzkw","avatar_url":"https://avatars2.githubusercontent.com/u/10960390?v=4","gravatar_id":"","url":"https://api.github.com/users/cyanstar","html_url":"https://github.com/cyanstar","followers_url":"https://api.github.com/users/cyanstar/followers","following_url":"https://api.github.com/users/cyanstar/following{/other_user}","gists_url":"https://api.github.com/users/cyanstar/gists{/gist_id}","starred_url":"https://api.github.com/users/cyanstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyanstar/subscriptions","organizations_url":"https://api.github.com/users/cyanstar/orgs","repos_url":"https://api.github.com/users/cyanstar/repos","events_url":"https://api.github.com/users/cyanstar/events{/privacy}","received_events_url":"https://api.github.com/users/cyanstar/received_events","type":"User","site_admin":false},"created_at":"2018-11-29T15:57:10Z","updated_at":"2018-11-29T15:57:10Z","author_association":"NONE","body":"@srdecny I'd use your option. Cleaner and doesn't output a bunch of useless CSS into the front end. PHP isn't my strong suite but slowly learning :).\r\n\r\nAs for your code, i'd change it slightly. As it stands that would hide the buttons for everyone even if they had permissions. I'd also place the PHP IF statement inside the table cells as not to break the front end UI.\r\n\r\nThe below works for the most part, but does throw an error if the role doesn't have the view permission. Not really sure how to get around it, as the view permission should be mandatory if they can edit, create or delete something, no? Not really should how you can edit something if you can't view it!\r\n\r\n```\r\n <td>\r\n    <?php if ($permissions['campaign:campaigns:view'] = 0 ):\r\n\r\n    elseif ($permissions['campaign:campaigns:full'] || $permissions['campaign:campaigns:edit'] || $permissions['campaign:campaigns:create'] || $permissions['campaign:campaigns:delete']):\r\n        echo $view->render(\r\n            'MauticCoreBundle:Helper:list_actions.html.php',\r\n            [\r\n                'item'            => $item,\r\n                'templateButtons' => [\r\n                    'edit'   => $permissions['campaign:campaigns:edit'],\r\n                    'clone'  => $permissions['campaign:campaigns:create'],\r\n                    'delete' => $permissions['campaign:campaigns:delete'],\r\n                ],\r\n                'routeBase' => 'campaign',\r\n            ]\r\n        );\r\n\r\n    endif;\r\n    ?>\r\n\r\n</td>\r\n```"}}
{"actor":{"display_login":"cyanstar"}}