{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/6920","labels_url":"https://api.github.com/repos/piwik/piwik/issues/6920/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/6920/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/6920/events","html_url":"https://github.com/piwik/piwik/issues/6920","id":53378439,"number":6920,"title":"To prevent abuse, autoArchive=1 requires Super User or ControllerAdmin access","user":{"login":"wesleyscottrichards","id":10398777,"avatar_url":"https://avatars.githubusercontent.com/u/10398777?v=3","gravatar_id":"","url":"https://api.github.com/users/wesleyscottrichards","html_url":"https://github.com/wesleyscottrichards","followers_url":"https://api.github.com/users/wesleyscottrichards/followers","following_url":"https://api.github.com/users/wesleyscottrichards/following{/other_user}","gists_url":"https://api.github.com/users/wesleyscottrichards/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleyscottrichards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleyscottrichards/subscriptions","organizations_url":"https://api.github.com/users/wesleyscottrichards/orgs","repos_url":"https://api.github.com/users/wesleyscottrichards/repos","events_url":"https://api.github.com/users/wesleyscottrichards/events{/privacy}","received_events_url":"https://api.github.com/users/wesleyscottrichards/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-05T09:34:53Z","updated_at":"2015-01-06T05:29:13Z","closed_at":"2015-01-06T05:29:13Z","body":"Hi there,\r\n\r\nwe've got Piwik 2.3.0 for our university in use and the various departments have their own Piwik ID. Overall, we have about 100 000 pageviews per day. Archiving of data is done via the cron job runs once per hour.\r\nIn the individual departments, there are users with normal privileges to view the statistics. These have so far also create segments. But which were generated at runtime what the performance is heavily loaded.\r\nI have now set in the config \"enable_create_realtime_segments = 0\".\r\nNow normal user can't create any segments anymore. That is very unfortunate.\r\nWhy do I need Admin rights to create segments that are archived by the cronjob?\r\n\r\n\r\nIs it a problem if I change the code in \"plugins/SegmentEditor/api.php in something like this?\r\n\r\nprotected function checkAutoArchive($autoArchive, $idSite)\r\n{\r\n    $autoArchive = (int)$autoArchive;\r\n        if ($autoArchive) {\r\n           $exception = new Exception(\"To prevent abuse, autoArchive=1 requires Super User or ontrollerAdmin access.\";\r\n        }\r\n        if (empty($idSite)) {\r\n            if (!Piwik::hasUserSuperUserAccess()) {\r\n                throw $exception;\r\n            }\r\n        } \r\n//else {\r\n//            if (!Piwik::isUserHasAdminAccess($idSite)) {\r\n//                throw $exception;\r\n//            }\r\n//        }\r\n    }\r\n    return $autoArchive;\r\n}\r\n\r\n\r\nPlease excuse my English. I hope you understand what I mean.\r\n\r\nThank you in advance for your efforts. \r\n\r\nWesley"},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/68828000","html_url":"https://github.com/piwik/piwik/issues/6920#issuecomment-68828000","issue_url":"https://api.github.com/repos/piwik/piwik/issues/6920","id":68828000,"user":{"login":"mattab","id":466765,"avatar_url":"https://avatars.githubusercontent.com/u/466765?v=3","gravatar_id":"","url":"https://api.github.com/users/mattab","html_url":"https://github.com/mattab","followers_url":"https://api.github.com/users/mattab/followers","following_url":"https://api.github.com/users/mattab/following{/other_user}","gists_url":"https://api.github.com/users/mattab/gists{/gist_id}","starred_url":"https://api.github.com/users/mattab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattab/subscriptions","organizations_url":"https://api.github.com/users/mattab/orgs","repos_url":"https://api.github.com/users/mattab/repos","events_url":"https://api.github.com/users/mattab/events{/privacy}","received_events_url":"https://api.github.com/users/mattab/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T05:29:13Z","updated_at":"2015-01-06T05:29:13Z","body":"Hi @wesleyscottrichards can you please upgrade to 2.10.0 ? the code looks already different as we fixed some issues there. see #6767 #6373 #5923 etc"}}