1
0
Fork 0
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:
Lunny Xiao 2018-11-28 19:26:14 +08:00 committed by GitHub
parent 0222623be9
commit eabbddcd98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 1360 additions and 774 deletions

View file

@ -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

View file

@ -391,7 +391,7 @@
is_mirror: false
-
id: 32
id: 32 # org public repo
owner_id: 3
lower_name: repo21
name: repo21

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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