Project statistics are not shown when repository is disabled
Security update 11.8.1 has introduced check to not show statistics for users who cannot pull code.
The implementation uses
:download_code ability, however this ability is explicitly disabled when repository is disabled.
This means that even admin can't check storage consumption of project with disabled repository.
Since disabled repository does not mean the storage is freed, this hides storage consumption. Admins need to have correct information about storage. Owners also, since admins may ask them to reduce it...
Additionally project statistics may/will/should include storage not directly related to repository (e.g. #57822 for wiki). Ideally whole storage consumption should be shown in the future (e.g. packages, docker registry, ...)
Steps to reproduce
Disable project repository and check statistics via API.
Observe statistics not provided.
What is the current bug behavior?
Statistics are not reported wiht disabled repository even for owner or admin.
What is the expected correct behavior?
Statistics are reported unconditionally with sufficient access rights.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com and also on self-managed instances.
Rewrite 618b8744 to not depend on repository features.