A possible solution for https://github.com/piwik/piwik/issues/6220, bear with me it is my first time writing a code for PIWIK core :D. I added a extra function for permission check and push the system check to diagnostic as was requested.
Thanks for the PR. I fixed the menu separately in #6220 since it was quite trivial :+1:
if you are interested to fix another bug (eg. the permission check) please create an issue for that one (or feel free to work on any other Easy pick issue: https://github.com/piwik/piwik/labels/Easy%20pick )