def _save_permission(self, permission):
        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 IOError as ex:
            ex.strerror = "can't save permission to file: %s" % ex.strerror
            raise
        except AssertionError as ex:
            raise ValueError(ex.message)
save permission to file
dataset/ETHPy150Open guyskk/flask-restaction/flask_restaction/auth.py/Auth._save_permission