1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 10:22:46 +00:00

admin api role check (#4353)

* admin api role check

* add check to new tabs and tests

* fix work-weixin virus scan check
This commit is contained in:
Leo
2019-12-16 18:31:29 +08:00
committed by lian
parent 44459bb36b
commit 7df1192cbf
84 changed files with 1089 additions and 142 deletions

View File

@@ -25,6 +25,14 @@ class DeviceAccessibleIpSetting(BaseTestCase):
json_resp = json.loads(resp.content)
assert '127.0.0.1' in [x['ip'] for x in json_resp]
@patch('seahub.api2.permissions.IsProVersion.has_permission')
def test_no_permission(self, mock_IsProVersion):
self.logout()
self.login_as(self.admin_no_other_permission)
mock_IsProVersion.return_value= True
resp = self.client.get(self.url)
assert resp.status_code == 403
@patch('seahub.api2.permissions.IsProVersion.has_permission')
def test_can_post(self, mock_IsProVersion):
mock_IsProVersion.return_value= True