Disable Performance bar shortcut for non-admin users

Summary

Disable Performance bar shortcut for non-admin users

Steps to reproduce

  1. Login in as non-admin user
  2. Press p b
  3. The page will reload

What is the expected correct behavior?

The Page should not reload and not save the perf_bar_enabled cookie

Relevant logs and/or screenshots

perf_bar_enabled Cookie (Removed some other cookies for security reasons)

Screenshot

Output of checks

This bug happens on GitLab.com

Possible fixes

Set Roles to this line with if conditions

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/behaviors/shortcuts/shortcuts.js#L26

Edited by Ghost User