]> source.dussan.org Git - gitea.git/commit
Ensure that restricted users can access repos for which they are members (#17460)
authorzeripath <art27@cantab.net>
Thu, 28 Oct 2021 02:54:40 +0000 (03:54 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Oct 2021 02:54:40 +0000 (10:54 +0800)
commit0b4a8be26bf9c2941f62ba9444ae9a60d432f0a9
tree6e62b0cd462515163850316bee0910a4b99bd040
parent2b2eb5d0ad0a632573da762a151ddae23c5b2e4a
Ensure that restricted users can access repos for which they are members (#17460)

There is a small bug in the way that repo access is checked in
repoAssignment: Accessibility is checked by checking if the user has a
marked access to the repository instead of checking if the user has any
team granted access.

This PR changes this permissions check to use HasAccess() which does the
correct test. There is also a fix in the release api ListReleases where
it should return draft releases if the user is a member of a team with
write access to the releases.

The PR also adds a testcase.

Signed-off-by: Andrew Thornton <art27@cantab.net>
integrations/org_test.go
models/fixtures/repository.yml
modules/context/repo.go
routers/api/v1/repo/release.go