def check_redaction(self, event, auth_events):
        user_level = self._get_user_power_level(event.user_id, auth_events)

        redact_level = self._get_named_level(auth_events, "redact", 50)

        if user_level >= redact_level:
            return False

        redacter_domain = EventID.from_string(event.event_id).domain
        redactee_domain = EventID.from_string(event.redacts).domain
        if redacter_domain == redactee_domain:
            return True

        raise AuthError(
            403,
            "You don't have permission to redact events"
        )
Create edit form from the MongoDB document
dataset/ETHPy150Open matrix-org/synapse/synapse/api/auth.py/Auth.check_redaction--crossover with--dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/pymongo/view.py/ModelView.edit_form