Skip to content

Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission #34053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 29, 2025

Conversation

lunny
Copy link
Member

@lunny lunny commented Mar 28, 2025

When a team have no code unit permission of a repository, the member of the team should not view activity contributors, recent commits and code frequrency.

@lunny lunny added type/bug backport/v1.23 This PR should be backported to Gitea 1.23 labels Mar 28, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 28, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Mar 28, 2025
@pull-request-size pull-request-size bot added size/M and removed size/S labels Mar 29, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 29, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 29, 2025
@yp05327
Copy link
Contributor

yp05327 commented Mar 29, 2025

Wait, I remember this issue has been mentioned in #32299?

It seems that it has been changed. (reqRepoCodeReader has been added into these routers)

@lunny lunny merged commit 4989907 into go-gitea:main Mar 29, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Mar 29, 2025
@wxiaoguang wxiaoguang deleted the lunny/fix_activity_perm branch March 29, 2025 04:07
@wxiaoguang
Copy link
Contributor

Wait, I remember this issue has been mentioned in #32299?

It seems that it has been changed. (reqRepoCodeReader has been added into these routers)

Yes, the permission checks were changed in #33127 and some other PRs.

The difference from #32299 is that we do not do CanReadAny(issue,pr,release) in Activity, but just leave the decisions to activities_model.GetActivityStats

There is still one change in 32299 is good to have:

https://github.com/go-gitea/gitea/pull/32299/files#diff-3edcc972bcc82fe6dc329fdd1b0a064dda283d3711d7c4b46552d90ff76c3696R211

@wxiaoguang
Copy link
Contributor

Made more changes in c132652

@yp05327
Copy link
Contributor

yp05327 commented Mar 29, 2025

There is still one change in 32299 is good to have

#34056

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 29, 2025

Made more changes in c132652

I have done it here 😄 (in #34051)

@GiteaBot
Copy link
Collaborator

I was unable to create a backport for 1.23. @lunny, please send one manually. 🍵

go run ./contrib/backport 34053
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Mar 29, 2025
lunny added a commit to lunny/gitea that referenced this pull request Mar 29, 2025
…abs if there is no code permission (go-gitea#34053)

When a team have no code unit permission of a repository, the member of
the team should not view activity contributors, recent commits and code
frequrency.

---------

Co-authored-by: wxiaoguang <[email protected]>
@lunny lunny added the backport/done All backports for this PR have been created label Mar 29, 2025
wxiaoguang added a commit that referenced this pull request Mar 30, 2025
…abs if there is no code permission (#34053) (#34065)

Backport #34053 

When a team have no code unit permission of a repository, the member of
the team should not view activity contributors, recent commits and code
frequrency.

---------

Co-authored-by: wxiaoguang <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 31, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Add toggleClass function in dom.ts (go-gitea#34063)
  Add a config option to block "expensive" pages for anonymous users (go-gitea#34024)
  add additional ReplaceAll in pathsep to cater for different pathsep (go-gitea#34061)
  [skip ci] Updated translations via Crowdin
  enable staticcheck QFxxxx rules (go-gitea#34064)
  update to golangci-lint v2 (go-gitea#34054)
  Add descriptions for private repo public access settings and improve the UI (go-gitea#34057)
  Add anonymous access support for private/unlisted repositories (go-gitea#34051)
  Hide activity contributors, recent commits and code frequrency left tabs if there is no code permission (go-gitea#34053)
  Update action status badge layout (go-gitea#34018)
  Add anonymous access support for private repositories (backend) (go-gitea#33257)
  Simplify emoji rendering (go-gitea#34048)
  Adjust the layout of the toolbar on the Issues/Projects page (go-gitea#33667)
  Fix bug on downloading job logs (go-gitea#34041)
  Fix git client accessing renamed repo  (go-gitea#34034)
  Decouple Batch from git.Repository to simplify usage without requiring the creation of a Repository struct. (go-gitea#34001)
  fix org repo creation being limited by user limits (go-gitea#34030)
  Fix the issue with error message logging for the `check-attr` command on Windows OS. (go-gitea#34035)
  Try to fix check-attr bug (go-gitea#34029)
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this pull request Apr 1, 2025
…abs if there is no code permission (go-gitea#34053)

When a team have no code unit permission of a repository, the member of
the team should not view activity contributors, recent commits and code
frequrency.

---------

Co-authored-by: wxiaoguang <[email protected]>
(cherry picked from commit 4989907)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.23 This PR should be backported to Gitea 1.23 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants