Exporters: Give access to authentication infos and allow empty permissions (#5979)

* Exporters: Give access to authentication infos

* Allow exporters to have empty permission

* Use a protocol
This commit is contained in:
Raphael Michel
2026-04-02 15:44:36 +02:00
committed by GitHub
parent 84e12fea32
commit d411c36414
5 changed files with 50 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ import operator
import secrets
from datetime import timedelta
from functools import reduce
from typing import Protocol
from django.conf import settings
from django.contrib.auth.models import (
@@ -67,6 +68,14 @@ class EmailAddressTakenError(IntegrityError):
pass
class PermissionHolder(Protocol):
def has_event_permission(self, organizer, event, perm_name=None, request=None, session_key=None) -> bool:
...
def has_organizer_permission(self, organizer, perm_name=None, request=None):
...
class UserManager(BaseUserManager):
"""
This is the user manager for our custom user model. See the User