コード例 #1
0
ファイル: test_host.py プロジェクト: axfxy2010/bk-bcs-saas
 def test_not_match_failed(self, biz_id, username):
     assert not can_use_hosts(biz_id, username, expect_used_ip_list)
コード例 #2
0
ファイル: utils.py プロジェクト: masanqi/bk-bcs-saas
def can_use_hosts(bk_biz_id: int, username: str, host_ips: List):
    has_perm = host_perms.can_use_hosts(bk_biz_id, username, host_ips)
    if not has_perm:
        raise PermissionDeniedError(_("用户{}没有主机:{}的权限,请联系管理员在【配置平台】添加为业务运维人员角色").format(username, host_ips), "")
コード例 #3
0
ファイル: test_host.py プロジェクト: axfxy2010/bk-bcs-saas
 def test_ok(self, biz_id, username):
     assert can_use_hosts(biz_id, username, expect_used_ip_list)