[PR #2118] [CLOSED] [WIP] Enforce usertype via GetIndividualUserByName #16239

Closed
opened 2025-11-02 12:05:39 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2118
Author: @sapk
Created: 7/6/2017
Status: Closed

Base: masterHead: enforce-usertype


📝 Commits (5)

  • e7ba9e8 Enforce user type
  • 14cb186 use generic GetUserByNameAndType for GetOrgByName
  • 23836ae Make ErrUserNotExist more generic
  • 2375d8d Add GetIndividualUserByName
  • 7e93f6d Enforce individual on collaborator

📊 Changes

14 files changed (+58 additions, -65 deletions)

View changed files

📝 models/error.go (+2 -17)
📝 models/login_source.go (+8 -8)
📝 models/org.go (+1 -14)
📝 models/org_team.go (+5 -2)
📝 models/org_test.go (+3 -2)
📝 models/user.go (+24 -7)
📝 models/user_mail.go (+1 -1)
📝 models/user_openid.go (+2 -2)
📝 modules/context/org.go (+3 -3)
📝 routers/api/v1/api.go (+1 -1)
📝 routers/api/v1/repo/collaborators.go (+3 -3)
📝 routers/api/v1/repo/fork.go (+1 -1)
📝 routers/api/v1/repo/repo.go (+1 -1)
📝 routers/user/home.go (+3 -3)

📄 Description

and switch to GetOrgByName when we want org.

As it modify the comportement of GetUserByName this need more testing (so WIP).
Maybe we will need a generic GetUserOrOrgByName method for some cases.

Follow #2117


🔄 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/2118 **Author:** [@sapk](https://github.com/sapk) **Created:** 7/6/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `enforce-usertype` --- ### 📝 Commits (5) - [`e7ba9e8`](https://github.com/go-gitea/gitea/commit/e7ba9e807fd5be36f394bdc34b86d769fe0ad440) Enforce user type - [`14cb186`](https://github.com/go-gitea/gitea/commit/14cb1866b8b9dc1d07c38b8aaf6aa7992f6dc1a6) use generic GetUserByNameAndType for GetOrgByName - [`23836ae`](https://github.com/go-gitea/gitea/commit/23836aee39fe23433a4bed10180a5f1530f8ea13) Make ErrUserNotExist more generic - [`2375d8d`](https://github.com/go-gitea/gitea/commit/2375d8d87b0cd840fb9f5c6a096ce6c98aa1165b) Add GetIndividualUserByName - [`7e93f6d`](https://github.com/go-gitea/gitea/commit/7e93f6dd93e40cae32202a0d11977328c4d7f97a) Enforce individual on collaborator ### 📊 Changes **14 files changed** (+58 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `models/error.go` (+2 -17) 📝 `models/login_source.go` (+8 -8) 📝 `models/org.go` (+1 -14) 📝 `models/org_team.go` (+5 -2) 📝 `models/org_test.go` (+3 -2) 📝 `models/user.go` (+24 -7) 📝 `models/user_mail.go` (+1 -1) 📝 `models/user_openid.go` (+2 -2) 📝 `modules/context/org.go` (+3 -3) 📝 `routers/api/v1/api.go` (+1 -1) 📝 `routers/api/v1/repo/collaborators.go` (+3 -3) 📝 `routers/api/v1/repo/fork.go` (+1 -1) 📝 `routers/api/v1/repo/repo.go` (+1 -1) 📝 `routers/user/home.go` (+3 -3) </details> ### 📄 Description and switch to GetOrgByName when we want org. As it modify the comportement of GetUserByName this need more testing (so WIP). Maybe we will need a generic GetUserOrOrgByName method for some cases. Follow #2117 --- <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 12:05:39 -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#16239