1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +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

@@ -13,6 +13,13 @@ class SysinfoTest(BaseTestCase):
def tearDown(self):
self.remove_repo()
def test_admin_permission_denied(self):
self.logout()
self.login_as(self.admin_cannot_view_system_info)
url = reverse('api-v2.1-sysinfo')
resp = self.client.get(url)
self.assertEqual(403, resp.status_code)
@patch('seahub.api2.endpoints.admin.sysinfo.is_pro_version')
def test_get_sysinfo_in_community_edition(self, mock_is_pro_version):