@contextmanager
    def _attachfile(self, filename):
        reportpath = os.path.join(self.logdir, filename)

        with open(reportpath, 'wb') as f:
            yield f
Does basic requested access validation.
dataset/ETHPy150Open allure-framework/allure-python/allure/common.py/AllureImpl._attachfile--crossover with--dataset/ETHPy150Open google/grr/grr/lib/aff4_objects/user_managers.py/ValidateAccessAndSubjects