forked from forgejo/forgejo
Restrict permission check on repositories and fix some problems (#5314)
* fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
This commit is contained in:
parent
0222623be9
commit
eabbddcd98
80 changed files with 1360 additions and 774 deletions
|
@ -108,4 +108,116 @@
|
|||
repo_id: 33
|
||||
type: 5
|
||||
config: "{}"
|
||||
created_unix: 1535593231
|
||||
created_unix: 1535593231
|
||||
|
||||
-
|
||||
id: 17
|
||||
repo_id: 4
|
||||
type: 4
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 18
|
||||
repo_id: 4
|
||||
type: 5
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 19
|
||||
repo_id: 4
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 20
|
||||
repo_id: 4
|
||||
type: 2
|
||||
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 21
|
||||
repo_id: 4
|
||||
type: 3
|
||||
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowSquash\":true}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 22
|
||||
repo_id: 2
|
||||
type: 4
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 23
|
||||
repo_id: 2
|
||||
type: 5
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 24
|
||||
repo_id: 2
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 25
|
||||
repo_id: 32
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 26
|
||||
repo_id: 32
|
||||
type: 2
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 27
|
||||
repo_id: 24
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 28
|
||||
repo_id: 24
|
||||
type: 2
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 29
|
||||
repo_id: 16
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 30
|
||||
repo_id: 23
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 31
|
||||
repo_id: 27
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
||||
|
||||
-
|
||||
id: 32
|
||||
repo_id: 28
|
||||
type: 1
|
||||
config: "{}"
|
||||
created_unix: 1524304355
|
|
@ -391,7 +391,7 @@
|
|||
is_mirror: false
|
||||
|
||||
-
|
||||
id: 32
|
||||
id: 32 # org public repo
|
||||
owner_id: 3
|
||||
lower_name: repo21
|
||||
name: repo21
|
||||
|
|
|
@ -51,3 +51,30 @@
|
|||
authorize: 4 # owner
|
||||
num_repos: 2
|
||||
num_members: 1
|
||||
|
||||
-
|
||||
id: 7
|
||||
org_id: 3
|
||||
lower_name: test_team
|
||||
name: test_team
|
||||
authorize: 2 # write
|
||||
num_repos: 1
|
||||
num_members: 1
|
||||
|
||||
-
|
||||
id: 8
|
||||
org_id: 17
|
||||
lower_name: test_team
|
||||
name: test_team
|
||||
authorize: 2 # write
|
||||
num_repos: 1
|
||||
num_members: 1
|
||||
|
||||
-
|
||||
id: 9
|
||||
org_id: 17
|
||||
lower_name: review_team
|
||||
name: review_team
|
||||
authorize: 1 # read
|
||||
num_repos: 1
|
||||
num_members: 1
|
|
@ -45,3 +45,21 @@
|
|||
org_id: 3
|
||||
team_id: 1
|
||||
repo_id: 32
|
||||
|
||||
-
|
||||
id: 9
|
||||
org_id: 3
|
||||
team_id: 7
|
||||
repo_id: 32
|
||||
|
||||
-
|
||||
id: 10
|
||||
org_id: 17
|
||||
team_id: 8
|
||||
repo_id: 24
|
||||
|
||||
-
|
||||
id: 11
|
||||
org_id: 17
|
||||
team_id: 9
|
||||
repo_id: 24
|
|
@ -207,3 +207,18 @@
|
|||
id: 42
|
||||
team_id: 6
|
||||
type: 7
|
||||
|
||||
-
|
||||
id: 43
|
||||
team_id: 7
|
||||
type: 2 # issues
|
||||
|
||||
-
|
||||
id: 44
|
||||
team_id: 8
|
||||
type: 2 # issues
|
||||
|
||||
-
|
||||
id: 45
|
||||
team_id: 9
|
||||
type: 1 # code
|
|
@ -44,4 +44,22 @@
|
|||
id: 8
|
||||
org_id: 19
|
||||
team_id: 6
|
||||
uid: 20
|
||||
|
||||
-
|
||||
id: 9
|
||||
org_id: 3
|
||||
team_id: 7
|
||||
uid: 15
|
||||
|
||||
-
|
||||
id: 10
|
||||
org_id: 17
|
||||
team_id: 8
|
||||
uid: 2
|
||||
|
||||
-
|
||||
id: 11
|
||||
org_id: 17
|
||||
team_id: 9
|
||||
uid: 20
|
|
@ -47,7 +47,7 @@
|
|||
avatar_email: user3@example.com
|
||||
num_repos: 3
|
||||
num_members: 2
|
||||
num_teams: 2
|
||||
num_teams: 3
|
||||
|
||||
-
|
||||
id: 4
|
||||
|
@ -266,7 +266,7 @@
|
|||
num_repos: 2
|
||||
is_active: true
|
||||
num_members: 2
|
||||
num_teams: 1
|
||||
num_teams: 3
|
||||
|
||||
-
|
||||
id: 18
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue