forked from kevadesu/forgejo
[BUG] Don't allow owner team with incorrect unit access
- On editting a team, only update the units if the team isn't the 'Owners' team. Otherwise the 'Owners' team end up having all of their unit access modes set to 'None'; because the request form doesn't send over any units, as it's simply not shown in the UI. - Adds a database inconstency check and fix for the case where the 'Owners' team is affected by this bug. - Adds unit test. - Adds integration test. - Resolves #5528 - Regression of https://github.com/go-gitea/gitea/pull/24012
This commit is contained in:
parent
4cb01ba5da
commit
9de9034400
7 changed files with 199 additions and 10 deletions
10
models/organization/TestInconsistentOwnerTeam/team.yml
Normal file
10
models/organization/TestInconsistentOwnerTeam/team.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
-
|
||||
id: 1000
|
||||
org_id: 1000
|
||||
lower_name: owners
|
||||
name: Owners
|
||||
authorize: 4 # owner
|
||||
num_repos: 0
|
||||
num_members: 0
|
||||
includes_all_repositories: true
|
||||
can_create_org_repo: true
|
59
models/organization/TestInconsistentOwnerTeam/team_unit.yml
Normal file
59
models/organization/TestInconsistentOwnerTeam/team_unit.yml
Normal file
|
@ -0,0 +1,59 @@
|
|||
-
|
||||
id: 1000
|
||||
team_id: 1000
|
||||
type: 1
|
||||
access_mode: 0 # None
|
||||
|
||||
-
|
||||
id: 1001
|
||||
team_id: 1000
|
||||
type: 2
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1002
|
||||
team_id: 1000
|
||||
type: 3
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1003
|
||||
team_id: 1000
|
||||
type: 4
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1004
|
||||
team_id: 1000
|
||||
type: 5
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1005
|
||||
team_id: 1000
|
||||
type: 6
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1006
|
||||
team_id: 1000
|
||||
type: 7
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1007
|
||||
team_id: 1000
|
||||
type: 8
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1008
|
||||
team_id: 1000
|
||||
type: 9
|
||||
access_mode: 0
|
||||
|
||||
-
|
||||
id: 1009
|
||||
team_id: 1000
|
||||
type: 10
|
||||
access_mode: 0
|
Loading…
Add table
Add a link
Reference in a new issue