def METHOD_NAME(self, perm_ctx: PermCtx, action_id: str, use_cache: bool = False) -> bool:
    res_id = perm_ctx.resource_id
    if res_id:  # 与当前资源实例相关
        res_request = self.make_res_request(perm_ctx)
        resources = res_request.make_resources(res_id)
        return self.resource_inst_allowed(perm_ctx.username, action_id, resources, use_cache)
    # 与当前资源实例无关, 并且无关联上级资源, 按资源实例无关处理
    if not self.has_parent_resource():
        return self.resource_type_allowed(perm_ctx.username, action_id, use_cache)
    # 有关联上级资源
    p_perm_ctx = self.parent_res_perm.perm_ctx_cls.from_dict(attr.asdict(perm_ctx))
    res_request = self.parent_res_perm.make_res_request(p_perm_ctx)
    resources = res_request.make_resources(p_perm_ctx.resource_id)
    return self.resource_inst_allowed(perm_ctx.username, action_id, resources, use_cache)