loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Store read access in access for team repo's (#20275)

- Currently when a Team has read access to a organization's non-private
repository, their access won't be stored in the database. This caused
issue for code that rely on read access being stored. So from now-on if
we see that the repository is owned by a organization don't increase the
minMode to write permission.
- Resolves #20083

authored by

Gusted and committed by
GitHub
8a7d1a35 cb6c5f81

+7 -1
+7 -1
models/perm/access/access.go
··· 86 86 // FIXME: do cross-comparison so reduce deletions and additions to the minimum? 87 87 func refreshAccesses(ctx context.Context, repo *repo_model.Repository, accessMap map[int64]*userAccess) (err error) { 88 88 minMode := perm.AccessModeRead 89 - if !repo.IsPrivate { 89 + if err := repo.GetOwner(ctx); err != nil { 90 + return fmt.Errorf("GetOwner: %v", err) 91 + } 92 + 93 + // If the repo isn't private and isn't owned by a organization, 94 + // increase the minMode to Write. 95 + if !repo.IsPrivate && !repo.Owner.IsOrganization() { 90 96 minMode = perm.AccessModeWrite 91 97 } 92 98