aboutsummaryrefslogtreecommitdiffstats
path: root/models/fixtures
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-11-28 19:26:14 +0800
committerGitHub <noreply@github.com>2018-11-28 19:26:14 +0800
commiteabbddcd98717ef20d8475e819f403c50f4a9787 (patch)
treeefc525e7ec60d56d3bec72019febfa088a128b89 /models/fixtures
parent0222623be9fa4a56d870213f77b92139cefc2518 (diff)
downloadgitea-eabbddcd98717ef20d8475e819f403c50f4a9787.tar.gz
gitea-eabbddcd98717ef20d8475e819f403c50f4a9787.zip
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
Diffstat (limited to 'models/fixtures')
-rw-r--r--models/fixtures/repo_unit.yml114
-rw-r--r--models/fixtures/repository.yml2
-rw-r--r--models/fixtures/team.yml27
-rw-r--r--models/fixtures/team_repo.yml18
-rw-r--r--models/fixtures/team_unit.yml15
-rw-r--r--models/fixtures/team_user.yml18
-rw-r--r--models/fixtures/user.yml4
7 files changed, 194 insertions, 4 deletions
diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml
index 581f9d6ed5..24d77b9997 100644
--- a/models/fixtures/repo_unit.yml
+++ b/models/fixtures/repo_unit.yml
@@ -108,4 +108,116 @@
repo_id: 33
type: 5
config: "{}"
- created_unix: 1535593231 \ No newline at end of file
+ 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 \ No newline at end of file
diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml
index c2987b9658..aa96656530 100644
--- a/models/fixtures/repository.yml
+++ b/models/fixtures/repository.yml
@@ -391,7 +391,7 @@
is_mirror: false
-
- id: 32
+ id: 32 # org public repo
owner_id: 3
lower_name: repo21
name: repo21
diff --git a/models/fixtures/team.yml b/models/fixtures/team.yml
index 4b4a1d798b..2d0dd9cd56 100644
--- a/models/fixtures/team.yml
+++ b/models/fixtures/team.yml
@@ -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 \ No newline at end of file
diff --git a/models/fixtures/team_repo.yml b/models/fixtures/team_repo.yml
index b324e09415..a523a90b20 100644
--- a/models/fixtures/team_repo.yml
+++ b/models/fixtures/team_repo.yml
@@ -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 \ No newline at end of file
diff --git a/models/fixtures/team_unit.yml b/models/fixtures/team_unit.yml
index ad5466a5c1..943745c000 100644
--- a/models/fixtures/team_unit.yml
+++ b/models/fixtures/team_unit.yml
@@ -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 \ No newline at end of file
diff --git a/models/fixtures/team_user.yml b/models/fixtures/team_user.yml
index b1dfcdfdef..e20b5c9684 100644
--- a/models/fixtures/team_user.yml
+++ b/models/fixtures/team_user.yml
@@ -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 \ No newline at end of file
diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml
index b3850e3599..dc3de2a2e1 100644
--- a/models/fixtures/user.yml
+++ b/models/fixtures/user.yml
@@ -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