Hide forks count if user does not have access to public project's repo
What does this MR do and why?
This MR will hide the forks count for the public project with restricted repository restriction if the user does not have access to the project.
There is a refactoring as well. I have removed the methods show_merge_request_count?
and show_issue_count?
because both methods were doing the same thing. So instead I have created a new method show_count?
Screenshots or screen recordings
How to set up and validate locally
- Run the local development
gdk start
- Log in as an admin user and change the Repository accessibility setting to the
Only Project Members
for a public project. - Without login go to http://127.0.0.1:3000/explore and verify that the forks count is not visible
- Without login search for the project http://127.0.0.1:3000/search and verify that the forks count is not visible on the search page
- Repeat steps 3 and 4 with login as a user who is not a member of the project
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #37977
Edited by Ravi Kumar