Skip to content
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

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

Closed
2 of 7 tasks
yyjdelete opened this issue Apr 18, 2019 · 0 comments · Fixed by #6897
Closed
2 of 7 tasks
Labels

Comments

@yyjdelete
Copy link

yyjdelete commented 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:https://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

@yyjdelete yyjdelete changed the title Search repos with keyword in homepage of organization should work for private organization Search repos with keyword in homepage of organization should work for private organization and owner Apr 18, 2019
@yyjdelete yyjdelete changed the title Search repos with keyword in homepage of organization should work for private organization and owner Search repos with keyword in homepage of organization should work for private organization and sysadmin Apr 18, 2019
@lunny lunny added the type/bug label Apr 19, 2019
zeripath added a commit to zeripath/gitea that referenced this issue May 9, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants