forked from forgejo/forgejo
Move some repository related code into sub package (#19711)
* Move some repository related code into sub package * Move more repository functions out of models * Fix lint * Some performance optimization for webhooks and others * some refactors * Fix lint * Fix * Update modules/repository/delete.go Co-authored-by: delvh <dev.lh@web.de> * Fix test * Merge * Fix test * Fix test * Fix test * Fix test Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
ebeb6e7c71
commit
26095115f4
76 changed files with 1756 additions and 1674 deletions
|
@ -55,7 +55,7 @@ func Code(ctx *context.Context) {
|
|||
|
||||
// guest user or non-admin user
|
||||
if ctx.Doer == nil || !isAdmin {
|
||||
repoIDs, err = models.FindUserAccessibleRepoIDs(ctx.Doer)
|
||||
repoIDs, err = repo_model.FindUserAccessibleRepoIDs(ctx.Doer)
|
||||
if err != nil {
|
||||
ctx.ServerError("SearchResults", err)
|
||||
return
|
||||
|
@ -79,7 +79,7 @@ func Code(ctx *context.Context) {
|
|||
rightRepoMap := make(map[int64]*repo_model.Repository, len(repoMaps))
|
||||
repoIDs = make([]int64, 0, len(repoMaps))
|
||||
for id, repo := range repoMaps {
|
||||
if models.CheckRepoUnitUser(repo, ctx.Doer, unit.TypeCode) {
|
||||
if models.CheckRepoUnitUser(ctx, repo, ctx.Doer, unit.TypeCode) {
|
||||
rightRepoMap[id] = repo
|
||||
repoIDs = append(repoIDs, id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue