Search repos with keyword in homepage of organization should work for private organization and sysadmin #3208

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

Originally created by @yyjdelete on GitHub (Apr 18, 2019).

  • Gitea version (or commit ref):1.8.0+rc3
  • Git version: 2.21.0
  • Operating system: Windows 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Related to the func added in #5986, #1763.

  1. Run an gitea server at local, and login as sysadmin;
  2. Create an private organization;
  3. Create an repo in the organization;
  4. Search the repo at homepage of the organization;
    See No matching repositories found.

http://gitea.xxx/orag1?q=rep&tab=&sort=recentupdate
a. Search repos in an private organization should return repos if I'm sysadmin(even if I'm also owner or member of the organization), like it does without keyword or it does for normal members.

b. And found "user.id" shouldn't be use as parameter of sql here in sql log.
https://github.com/go-gitea/gitea/blob/v1.8.0-rc3/models/repo_list.go#L208

c.orderBy not work when ctx.IsSigned && !ctx.User.IsAdmin
https://github.com/go-gitea/gitea/blob/v1.8.0-rc3/routers/user/home.go#L438-L481

d. SearchRepositoryByName use the same param OwnerID for search target and access check for org, and may not work well if they should be different.(Not the same as a, since sysadmin should simply skip all access check)

Screenshots

image
image

Originally created by @yyjdelete on GitHub (Apr 18, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref):1.8.0+rc3 - Git version: 2.21.0 - Operating system: Windows 10 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Related to the func added in #5986, #1763. 1. Run an gitea server at local, and login as sysadmin; 2. Create an private organization; 3. Create an repo in the organization; 4. Search the repo at homepage of the organization; See `No matching repositories found.` http://gitea.xxx/orag1?q=rep&tab=&sort=recentupdate a. Search repos in an private organization should return repos if I'm sysadmin(even if I'm also owner or member of the organization), like it does without keyword or it does for normal members. b. And found `"user.id"` shouldn't be use as parameter of sql here in sql log. https://github.com/go-gitea/gitea/blob/v1.8.0-rc3/models/repo_list.go#L208 c.`orderBy` not work when `ctx.IsSigned && !ctx.User.IsAdmin` https://github.com/go-gitea/gitea/blob/v1.8.0-rc3/routers/user/home.go#L438-L481 d. `SearchRepositoryByName` use the same param `OwnerID` for search target and access check for org, and may not work well if they should be different.(Not the same as a, since sysadmin should simply skip all access check) ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![image](https://user-images.githubusercontent.com/1819074/56357284-ebb33d00-620d-11e9-96f7-6ae89a74e5f5.png) ![image](https://user-images.githubusercontent.com/1819074/56357293-f5d53b80-620d-11e9-9aee-1e9dd8d711d1.png)
GiteaMirror added the type/bug label 2025-11-02 05:03:54 -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#3208