def _save_permission(self, permission):
        """save permission to file"""
        try:
            config = parse_config(self.resource, permission)
            with codecs.open(self.permission_json, "w", encoding="utf-8") as f:
                json.dump(permission, f, indent=4,
                          ensure_ascii=False, sort_keys=True)
            self.permission = permission
            self.config = config
        except __HOLE__ as ex:
            ex.strerror = "can't save permission to file: %s" % ex.strerror
            raise
        except AssertionError as ex:
            raise ValueError(ex.message)
dataset/ETHPy150Open guyskk/flask-restaction/flask_restaction/auth.py/Auth._save_permission