[PR #1247] [MERGED] Refactor and fix incorrect comment #15830

Closed
opened 2025-11-02 11:55:37 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/1247
Author: @ethantkoenig
Created: 3/14/2017
Status: Merged
Merged: 3/15/2017
Merged by: @lunny

Base: masterHead: refactor/access


📝 Commits (1)

  • c200715 Refactor and fix incorrect comment

📊 Changes

20 files changed (+74 additions, -84 deletions)

View changed files

📝 cmd/serv.go (+1 -1)
📝 models/access.go (+12 -12)
📝 models/access_test.go (+8 -8)
📝 models/issue.go (+9 -18)
📝 models/org_team.go (+20 -14)
📝 models/org_team_test.go (+1 -1)
📝 models/release.go (+1 -1)
📝 models/repo.go (+1 -1)
📝 models/ssh_key.go (+1 -1)
📝 models/user.go (+3 -3)
📝 modules/context/repo.go (+1 -1)
📝 modules/lfs/server.go (+2 -2)
📝 routers/api/v1/api.go (+1 -1)
📝 routers/api/v1/org/team.go (+3 -3)
📝 routers/api/v1/repo/fork.go (+1 -1)
📝 routers/api/v1/repo/release.go (+1 -1)
📝 routers/api/v1/repo/repo.go (+3 -3)
📝 routers/api/v1/user/star.go (+2 -5)
📝 routers/api/v1/user/watch.go (+1 -5)
📝 routers/repo/http.go (+2 -2)

📄 Description

  • Replace the *User arguments to [aA]ccessLevel(..), [hH]asAccess(..) to int64 userID arguments to avoid unnecessary loads
  • Fix incorrect specifications for AccessLevel(..) HasAccess(..)
  • Add a getTeamUsersByTeamID(..) helper function to avoid unnecessary loads

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/1247 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 3/14/2017 **Status:** ✅ Merged **Merged:** 3/15/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `refactor/access` --- ### 📝 Commits (1) - [`c200715`](https://github.com/go-gitea/gitea/commit/c2007152f51fc3d5656e5ff9165e560820445cc2) Refactor and fix incorrect comment ### 📊 Changes **20 files changed** (+74 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `cmd/serv.go` (+1 -1) 📝 `models/access.go` (+12 -12) 📝 `models/access_test.go` (+8 -8) 📝 `models/issue.go` (+9 -18) 📝 `models/org_team.go` (+20 -14) 📝 `models/org_team_test.go` (+1 -1) 📝 `models/release.go` (+1 -1) 📝 `models/repo.go` (+1 -1) 📝 `models/ssh_key.go` (+1 -1) 📝 `models/user.go` (+3 -3) 📝 `modules/context/repo.go` (+1 -1) 📝 `modules/lfs/server.go` (+2 -2) 📝 `routers/api/v1/api.go` (+1 -1) 📝 `routers/api/v1/org/team.go` (+3 -3) 📝 `routers/api/v1/repo/fork.go` (+1 -1) 📝 `routers/api/v1/repo/release.go` (+1 -1) 📝 `routers/api/v1/repo/repo.go` (+3 -3) 📝 `routers/api/v1/user/star.go` (+2 -5) 📝 `routers/api/v1/user/watch.go` (+1 -5) 📝 `routers/repo/http.go` (+2 -2) </details> ### 📄 Description - Replace the `*User` arguments to `[aA]ccessLevel(..)`, `[hH]asAccess(..)` to `int64` userID arguments to avoid unnecessary loads - Fix incorrect specifications for `AccessLevel(..)` `HasAccess(..)` - Add a `getTeamUsersByTeamID(..)` helper function to avoid unnecessary loads --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:55:37 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15830