diff options
author | zeripath <art27@cantab.net> | 2021-10-28 03:54:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 10:54:40 +0800 |
commit | 0b4a8be26bf9c2941f62ba9444ae9a60d432f0a9 (patch) | |
tree | 6e62b0cd462515163850316bee0910a4b99bd040 /models/fixtures | |
parent | 2b2eb5d0ad0a632573da762a151ddae23c5b2e4a (diff) | |
download | gitea-0b4a8be26bf9c2941f62ba9444ae9a60d432f0a9.tar.gz gitea-0b4a8be26bf9c2941f62ba9444ae9a60d432f0a9.zip |
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>
Diffstat (limited to 'models/fixtures')
-rw-r--r-- | models/fixtures/repository.yml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml index 6860d00b30..dc8ebecfc5 100644 --- a/models/fixtures/repository.yml +++ b/models/fixtures/repository.yml @@ -568,7 +568,7 @@ - id: 40 owner_id: 23 - owner_name: limited_org + owner_name: privated_org lower_name: public_repo_on_private_org name: public_repo_on_private_org is_private: false @@ -581,7 +581,7 @@ - id: 41 owner_id: 23 - owner_name: limited_org + owner_name: privated_org lower_name: private_repo_on_private_org name: private_repo_on_private_org is_private: true |