Show More
@@ -68,7 +68,6 b' class TestGetRepo(object):' | |||
|
68 | 68 | followers.append(user.user.get_api_data( |
|
69 | 69 | include_secrets=expect_secrets)) |
|
70 | 70 | |
|
71 | ret['members'] = permissions | |
|
72 | 71 | ret['permissions'] = permissions |
|
73 | 72 | ret['followers'] = followers |
|
74 | 73 | |
@@ -106,7 +105,6 b' class TestGetRepo(object):' | |||
|
106 | 105 | for user in repo.followers: |
|
107 | 106 | followers.append(user.user.get_api_data()) |
|
108 | 107 | |
|
109 | ret['members'] = permissions | |
|
110 | 108 | ret['permissions'] = permissions |
|
111 | 109 | ret['followers'] = followers |
|
112 | 110 |
@@ -41,7 +41,7 b' class TestApiGetRepoGroup(object):' | |||
|
41 | 41 | |
|
42 | 42 | permissions = expected_permissions(repo_group) |
|
43 | 43 | |
|
44 |
ret[' |
|
|
44 | ret['permissions'] = permissions | |
|
45 | 45 | expected = ret |
|
46 | 46 | assert_ok(id_, expected, given=response.body) |
|
47 | 47 |
@@ -36,7 +36,9 b' class TestGetUser(object):' | |||
|
36 | 36 | |
|
37 | 37 | usr = UserModel().get_by_username(TEST_USER_ADMIN_LOGIN) |
|
38 | 38 | ret = usr.get_api_data(include_secrets=True) |
|
39 |
|
|
|
39 | permissions = AuthUser(usr.user_id).permissions | |
|
40 | ret['permissions'] = permissions | |
|
41 | ret['permissions_summary'] = permissions | |
|
40 | 42 | |
|
41 | 43 | expected = ret |
|
42 | 44 | assert_ok(id_, expected, given=response.body) |
@@ -54,7 +56,9 b' class TestGetUser(object):' | |||
|
54 | 56 | |
|
55 | 57 | usr = UserModel().get_by_username(TEST_USER_ADMIN_LOGIN) |
|
56 | 58 | ret = usr.get_api_data(include_secrets=True) |
|
57 |
|
|
|
59 | permissions = AuthUser(usr.user_id).permissions | |
|
60 | ret['permissions'] = permissions | |
|
61 | ret['permissions_summary'] = permissions | |
|
58 | 62 | |
|
59 | 63 | expected = ret |
|
60 | 64 | assert_ok(id_, expected, given=response.body) |
@@ -65,7 +69,9 b' class TestGetUser(object):' | |||
|
65 | 69 | |
|
66 | 70 | usr = UserModel().get_by_username(self.TEST_USER_LOGIN) |
|
67 | 71 | ret = usr.get_api_data(include_secrets=True) |
|
68 |
|
|
|
72 | permissions = AuthUser(usr.user_id).permissions | |
|
73 | ret['permissions'] = permissions | |
|
74 | ret['permissions_summary'] = permissions | |
|
69 | 75 | |
|
70 | 76 | expected = ret |
|
71 | 77 | assert_ok(id_, expected, given=response.body) |
@@ -38,7 +38,8 b' class TestGetUserGroups(object):' | |||
|
38 | 38 | |
|
39 | 39 | permissions = expected_permissions(group) |
|
40 | 40 | |
|
41 |
ret[' |
|
|
41 | ret['permissions'] = permissions | |
|
42 | ret['permissions_summary'] = response.json['result']['permissions_summary'] | |
|
42 | 43 | expected = ret |
|
43 | 44 | assert_ok(id_, expected, given=response.body) |
|
44 | 45 | |
@@ -54,7 +55,8 b' class TestGetUserGroups(object):' | |||
|
54 | 55 | |
|
55 | 56 | permissions = expected_permissions(group) |
|
56 | 57 | |
|
57 |
ret[' |
|
|
58 | ret['permissions'] = permissions | |
|
59 | ret['permissions_summary'] = response.json['result']['permissions_summary'] | |
|
58 | 60 | expected = ret |
|
59 | 61 | assert_ok(id_, expected, given=response.body) |
|
60 | 62 |
@@ -127,26 +127,6 b' def get_repo(request, apiuser, repoid, c' | |||
|
127 | 127 | "lock_reason": null, |
|
128 | 128 | "locked_by": null, |
|
129 | 129 | "locked_date": null, |
|
130 | "members": [ | |
|
131 | { | |
|
132 | "name": "super-admin-name", | |
|
133 | "origin": "super-admin", | |
|
134 | "permission": "repository.admin", | |
|
135 | "type": "user" | |
|
136 | }, | |
|
137 | { | |
|
138 | "name": "owner-name", | |
|
139 | "origin": "owner", | |
|
140 | "permission": "repository.admin", | |
|
141 | "type": "user" | |
|
142 | }, | |
|
143 | { | |
|
144 | "name": "user-group-name", | |
|
145 | "origin": "permission", | |
|
146 | "permission": "repository.write", | |
|
147 | "type": "user_group" | |
|
148 | } | |
|
149 | ], | |
|
150 | 130 | "owner": "owner-name", |
|
151 | 131 | "permissions": [ |
|
152 | 132 | { |
@@ -63,7 +63,7 b' def get_repo_group(request, apiuser, rep' | |||
|
63 | 63 | "group_description": "repo group description", |
|
64 | 64 | "group_id": 14, |
|
65 | 65 | "group_name": "group name", |
|
66 |
" |
|
|
66 | "permissions": [ | |
|
67 | 67 | { |
|
68 | 68 | "name": "super-admin-username", |
|
69 | 69 | "origin": "super-admin", |
@@ -79,7 +79,8 b' def get_user(request, apiuser, userid=Op' | |||
|
79 | 79 | "last_login": "Timestamp", |
|
80 | 80 | "last_activity": "Timestamp", |
|
81 | 81 | "lastname": "surnae", |
|
82 |
"permissions": |
|
|
82 | "permissions": <deprecated>, | |
|
83 | "permissions_summary": { | |
|
83 | 84 | "global": [ |
|
84 | 85 | "hg.inherit_default_perms.true", |
|
85 | 86 | "usergroup.read", |
@@ -97,7 +98,7 b' def get_user(request, apiuser, userid=Op' | |||
|
97 | 98 | "repositories": { "username/example": "repository.write"}, |
|
98 | 99 | "repositories_groups": { "user-group/repo": "group.none" }, |
|
99 | 100 | "user_groups": { "user_group_name": "usergroup.read" } |
|
100 |
} |
|
|
101 | } | |
|
101 | 102 | "user_id": 32, |
|
102 | 103 | "username": "username" |
|
103 | 104 | } |
@@ -61,7 +61,7 b' def get_user_group(request, apiuser, use' | |||
|
61 | 61 | "active": true, |
|
62 | 62 | "group_description": "group description", |
|
63 | 63 | "group_name": "group name", |
|
64 |
" |
|
|
64 | "permissions": [ | |
|
65 | 65 | { |
|
66 | 66 | "name": "owner-name", |
|
67 | 67 | "origin": "owner", |
@@ -82,6 +82,12 b' def get_user_group(request, apiuser, use' | |||
|
82 | 82 | "type": "user_group" |
|
83 | 83 | } |
|
84 | 84 | ], |
|
85 | "permissions_summary": { | |
|
86 | "repositories": { | |
|
87 | "aa-root-level-repo-1": "repository.admin" | |
|
88 | }, | |
|
89 | "repositories_groups": {} | |
|
90 | }, | |
|
85 | 91 | "owner": "owner name", |
|
86 | 92 | "users": [], |
|
87 | 93 | "users_group_id": 2 |
@@ -120,7 +126,7 b' def get_user_group(request, apiuser, use' | |||
|
120 | 126 | |
|
121 | 127 | data = user_group.get_api_data() |
|
122 | 128 | data["permissions"] = permissions |
|
123 |
data[" |
|
|
129 | data["permissions_summary"] = UserGroupModel().get_perms_summary( | |
|
124 | 130 | user_group.users_group_id) |
|
125 | 131 | return data |
|
126 | 132 |
General Comments 0
You need to be logged in to leave comments.
Login now