You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
zeripath ef12b8de80
Ensure that restricted users can access repos for which they are members (#17460) (#17464)
Backport #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>
3 years ago
..
fixtures Ensure that restricted users can access repos for which they are members (#17460) (#17464) 3 years ago
migrations Add primary_key to issue_index (#16813) (#16820) 4 years ago
access.go Nicely handle missing user in collaborations (#17049) (#17166) 3 years ago
access_test.go Fix "access" fixtures and tests (#10247) 5 years ago
action.go Improve notifications for WIP draft PR's (#14663) 4 years ago
action_list.go refactor: reduce sql query in retrieveFeeds (#3547) 7 years ago
action_test.go Clarify the suffices and prefixes of setting.AppSubURL and setting.AppURL (#12999) 4 years ago
admin.go improve empty notice (#15890) 4 years ago
admin_test.go Fix tests code to prevent some runtime errors (#2381) 8 years ago
attachment.go Fix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971) (#16977) 3 years ago
attachment_test.go Fixed assert statements. (#16089) 4 years ago
avatar.go Double the avatar size factor (#15941) 4 years ago
avatar_test.go Fix individual tests (addition to #15802) (#15818) 4 years ago
branches.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
branches_test.go Add deleted_branch table fixture (#2832) 7 years ago
commit_status.go Fix session bugs (#16552) (#16553) 4 years ago
commit_status_test.go Fix bug about ListOptions and stars/watchers pagnation (#14556) 4 years ago
consistency.go Update milestone counters on new issue. (#16183) 4 years ago
consistency_test.go Fix orphaned objects deletion bug (#15657) 4 years ago
context.go Correctly rollback in ForkRepository (#17034) (#17045) 3 years ago
convert.go just add some unit tests (#16291) 4 years ago
error.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
error_oauth2.go gofmt (#1662) 8 years ago
external_login_user.go chore(models): rewrite code format. (#14754) 4 years ago
fixture_generation.go chore(models): rewrite code format. (#14754) 4 years ago
fixture_test.go Move fixture generation to contrib and add test (#10277) 5 years ago
gpg_key.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
gpg_key_add.go Handle duplicate keys on GPG key ring (#17242) (#17284) 3 years ago
gpg_key_commit_verification.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
gpg_key_common.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
gpg_key_import.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
gpg_key_test.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
gpg_key_verify.go Add option to provide signature for a token to verify key ownership (#14054) 4 years ago
helper.go chore(models): rewrite code format. (#14754) 4 years ago
helper_directory.go Re-attempt to delete temporary upload if the file is locked by another process (#12447) 5 years ago
helper_environment.go chore(models): rewrite code format. (#14754) 4 years ago
index.go Add unique constraint back into issue_index (#16938) 3 years ago
index_test.go Add a new table issue_index to store the max issue index so that issue could be deleted with no duplicated index (#15599) 4 years ago
issue.go Update issue_index to finish migration (#16685) (#16687) 4 years ago
issue_assignees.go chore(models): rewrite code format. (#14754) 4 years ago
issue_assignees_test.go Fix individual tests (addition to #15802) (#15818) 4 years ago
issue_comment.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
issue_comment_list.go chore(models): rewrite code format. (#14754) 4 years ago
issue_comment_test.go Pull request review/approval and comment on code (#3748) 7 years ago
issue_dependency.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
issue_dependency_test.go Refactor comment (#9330) 5 years ago
issue_label.go Code Formats, Nits & Unused Func/Var deletions (#15286) 4 years ago
issue_label_test.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
issue_list.go Performance improvement for list pull requests (#15447) 4 years ago
issue_list_test.go Add Organization Wide Labels (#10814) 5 years ago
issue_lock.go chore(models): rewrite code format. (#14754) 4 years ago
issue_milestone.go Update milestone counters on new issue. (#16183) 4 years ago
issue_milestone_test.go Update milestone counters on new issue. (#16183) 4 years ago
issue_reaction.go chore(models): rewrite code format. (#14754) 4 years ago
issue_reaction_test.go Migrate reactions when migrating repository from github (#9599) 5 years ago
issue_stopwatch.go Fix session bugs (#16552) (#16553) 4 years ago
issue_stopwatch_test.go Fixed assert statements. (#16089) 4 years ago
issue_test.go Add a new table issue_index to store the max issue index so that issue could be deleted with no duplicated index (#15599) 4 years ago
issue_tracked_time.go chore(models): rewrite code format. (#14754) 4 years ago
issue_tracked_time_test.go chore(models): rewrite code format. (#14754) 4 years ago
issue_user.go Mail assignee when issue/pull request is assigned (#8546) 5 years ago
issue_user_test.go Add "Update Branch" button to Pull Requests (#9784) 5 years ago
issue_watch.go chore(models): rewrite code format. (#14754) 4 years ago
issue_watch_test.go Fixed assert statements. (#16089) 4 years ago
issue_xref.go don't record error when loading ref comment but ref comment id is zero (#15820) 4 years ago
issue_xref_test.go Add a new table issue_index to store the max issue index so that issue could be deleted with no duplicated index (#15599) 4 years ago
lfs.go Code Formats, Nits & Unused Func/Var deletions (#15286) 4 years ago
lfs_lock.go chore(models): rewrite code format. (#14754) 4 years ago
list_options.go Fix list_options GetStartEnd (#16303) 4 years ago
log.go Fix xorm log stack level (#15285) 4 years ago
login_source.go Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136) (#17137) 3 years ago
main_test.go Add gitea-vet (#10948) 5 years ago
migrate.go Fix delete nonexist oauth application 500 and prevent deadlock (#15384) 4 years ago
models.go Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848) 3 years ago
models_test.go Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848) 3 years ago
notification.go Improve notifications for WIP draft PR's (#14663) 4 years ago
notification_test.go add request review from specific reviewers feature in pull request (#10756) 5 years ago
oauth2.go Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16570) 4 years ago
oauth2_application.go Switch to maintained jwt lib (#16532) (#16533) 4 years ago
oauth2_application_test.go Fixed assert statements. (#16089) 4 years ago
org.go Fix incorrect repository count on organization tab of dashboard (#17266) 3 years ago
org_team.go chore(models): rewrite code format. (#14754) 4 years ago
org_team_test.go chore(models): rewrite code format. (#14754) 4 years ago
org_test.go Add Visible modes function from Organisation to Users too (#16069) 4 years ago
project.go chore(models): rewrite code format. (#14754) 4 years ago
project_board.go chore(models): rewrite code format. (#14754) 4 years ago
project_issue.go chore(models): rewrite code format. (#14754) 4 years ago
project_test.go chore(models): rewrite code format. (#14754) 4 years ago
protected_tag.go Add tag protection (#15629) 4 years ago
protected_tag_test.go Add tag protection (#15629) 4 years ago
pull.go Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227) 3 years ago
pull_list.go API add/generalize pagination (#9452) 5 years ago
pull_sign.go Add configurable Trust Models (#11712) 4 years ago
pull_test.go Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223) (#17227) 3 years ago
release.go [API] ListReleases add filter for draft and pre-releases (#16175) 4 years ago
repo.go Ensure that git daemon export ok is created for mirrors (#17243) (#17306) 3 years ago
repo_activity.go Add top author stats to activity page (#9615) 5 years ago
repo_archiver.go Fix archive error when rename repo or user (#16399) 4 years ago
repo_avatar.go Avatars and Repo avatars support storing in minio (#12516) 4 years ago
repo_branch.go Move newbranch to standalone package (#9627) 5 years ago
repo_collaboration.go Nicely handle missing user in collaborations (#17049) (#17166) 3 years ago
repo_collaboration_test.go API add/generalize pagination (#9452) 5 years ago
repo_generate.go Refactor renders (#15175) 4 years ago
repo_generate_test.go Fixed assert statements. (#16089) 4 years ago
repo_indexer.go Index code and stats only for non-empty repositories (#10251) 5 years ago
repo_issue.go Add EnableTimetracking option to app settings (#3719) 7 years ago
repo_language_stats.go chore(models): rewrite code format. (#14754) 4 years ago
repo_list.go not show private user's repo in explore view (#16550) (#16554) 4 years ago
repo_list_test.go chore(models): rewrite code format. (#14754) 4 years ago
repo_mirror.go Add push to remote mirror repository (#15157) 4 years ago
repo_permission.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
repo_permission_test.go fix bug when update owner team then visit team's repo return 404 (#6119) 6 years ago
repo_pushmirror.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
repo_pushmirror_test.go Add push to remote mirror repository (#15157) 4 years ago
repo_redirect.go Redirect on changed user and org name (#11649) 4 years ago
repo_redirect_test.go Redirect on changed user and org name (#11649) 4 years ago
repo_sign.go Add configurable Trust Models (#11712) 4 years ago
repo_test.go Fixed assert statements. (#16089) 4 years ago
repo_transfer.go Nicely handle missing user in collaborations (#17049) (#17166) 3 years ago
repo_transfer_test.go chore(models): rewrite code format. (#14754) 4 years ago
repo_unit.go Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136) (#17137) 3 years ago
repo_watch.go chore(models): rewrite code format. (#14754) 4 years ago
repo_watch_test.go API add/generalize pagination (#9452) 5 years ago
review.go Fix unwanted team review request deletion (#17257) (#17264) 3 years ago
review_test.go Ensure review dismissal only dismisses the correct review (#15477) 4 years ago
session.go Fix DB session cleanup (#15697) 4 years ago
sql_postgres_with_schema.go Ensure that schema search path is set with every connection on postgres (#14131) 4 years ago
ssh_key.go Retry rename on lock induced failures (#16435) 4 years ago
ssh_key_test.go Add support for ed25519_sk and ecdsa_sk SSH keys (#13462) 4 years ago
star.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124) 4 years ago
star_test.go API add/generalize pagination (#9452) 5 years ago
task.go Add Status Updates whilst Gitea migrations are occurring (#15076) 4 years ago
test_fixtures.go Create Proper Migration Tests (#15116) 4 years ago
token.go Only check access tokens if they are likely to be tokens (#16164) 4 years ago
token_test.go chore(models): rewrite code format. (#14754) 4 years ago
topic.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
topic_test.go Fixed assert statements. (#16089) 4 years ago
twofactor.go Use single shared random string generation function (#15741) 4 years ago
u2f.go Don't panic if we fail to parse U2FRegistration data (#17304) (#17371) 3 years ago
u2f_test.go Don't panic if we fail to parse U2FRegistration data (#17304) (#17371) 3 years ago
unit.go Kanban board (#8346) 5 years ago
unit_tests.go Rework repository archive (#14723) 4 years ago
update.go Remove Unused Functions (#10516) 5 years ago
upload.go Handle and propagate errors when checking if paths are Dirs, Files or Exist (#13186) 4 years ago
user.go Fix broken Activities link in team dashboard (#17255) (#17258) 3 years ago
user_avatar.go Send size to /avatars if requested (#15459) 4 years ago
user_follow.go Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124) 4 years ago
user_follow_test.go Add gitea-vet (#10948) 5 years ago
user_heatmap.go Fix heatmap activity (#15252) 4 years ago
user_heatmap_test.go Allow mocking timeutil (#17354) (#17356) 3 years ago
user_mail.go Fix activation of primary email addresses (#16385) 4 years ago
user_mail_test.go Always store primary email address into email_address table and also the state (#15956) 4 years ago
user_openid.go Code Formats, Nits & Unused Func/Var deletions (#15286) 4 years ago
user_openid_test.go Fixed assert statements. (#16089) 4 years ago
user_redirect.go Redirect on changed user and org name (#11649) 4 years ago
user_redirect_test.go Redirect on changed user and org name (#11649) 4 years ago
user_test.go Make allowed Visiblity modes configurable for Users (#16271) 4 years ago
userlist.go chore(models): rewrite code format. (#14754) 4 years ago
userlist_test.go chore(models): rewrite code format. (#14754) 4 years ago
webhook.go Refactor Webhook + Add X-Hub-Signature (#16176) 4 years ago
webhook_test.go Refactor Webhook + Add X-Hub-Signature (#16176) 4 years ago
wiki.go Handle and propagate errors when checking if paths are Dirs, Files or Exist (#13186) 4 years ago
wiki_test.go Move wiki related funtions from models to services/wiki (#9355) 5 years ago