def METHOD_NAME(self, perm_ctx: PermCtx, action_id: str):
    """抛出 PermissionDeniedError 异常, 其中 username 和 action_request_list 可用于生成权限申请跳转链接"""
    res_id = perm_ctx.resource_id
    resources = None
    resource_type = self.resource_type
    parent_chain = None
    if res_id:
        resources = [res_id]
        parent_chain = perm_ctx.get_parent_chain()
    elif self.has_parent_resource():
        resource_type = self.parent_res_perm.resource_type
        p_perm_ctx = self.parent_res_perm.perm_ctx_cls.from_dict(attr.asdict(perm_ctx))
        resources = [p_perm_ctx.resource_id]
        parent_chain = p_perm_ctx.get_parent_chain()
    raise PermissionDeniedError(
        f"no {action_id} permission",
        username=perm_ctx.username,
        action_request_list=[ActionResourcesRequest(action_id, resource_type, resources, parent_chain)],
    )