def METHOD_NAME(cls, module, name, acl, **kwargs):
    existing = cls.get_acl(module, name, raw=True, **kwargs)
    existing_principals = {x.principal for x in existing}
    for principal in acl - existing_principals:
        db.session.add(cls(module=module, name=name, principal=principal, **kwargs))
    for setting in existing:
        if setting.principal not in acl:
            db.session.delete(setting)
    db.session.flush()