예제 #1
0
 def test_not_match_failed(self, biz_id, username):
     assert not can_use_hosts(biz_id, username, expect_used_ip_list)
예제 #2
0
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
 def test_ok(self, biz_id, username):
     assert can_use_hosts(biz_id, username, expect_used_ip_list)