Skip to content
Snippets Groups Projects
dynamic_preferences_registry.py 693 B
Newer Older
  • Learn to ignore specific revisions
  • from dynamic_preferences import types
    from dynamic_preferences.registries import global_preferences_registry
    
    from funkwhale_api.common import preferences
    
    
    Eliot Berriot's avatar
    Eliot Berriot committed
    common = types.Section("common")
    
    
    
    @global_preferences_registry.register
    class APIAutenticationRequired(
    
    Eliot Berriot's avatar
    Eliot Berriot committed
        preferences.DefaultFromSettingMixin, types.BooleanPreference
    ):
    
    Eliot Berriot's avatar
    Eliot Berriot committed
        name = "api_authentication_required"
        verbose_name = "API Requires authentication"
        setting = "API_AUTHENTICATION_REQUIRED"
    
    Eliot Berriot's avatar
    Eliot Berriot committed
            "If disabled, anonymous users will be able to query the API"
            "and access music data (as well as other data exposed in the API "
            "without specific permissions)."