soundwave/backend/common/views.py
Iulian 51679d1943 Initial commit - SoundWave v1.0
- Full PWA support with offline capabilities
- Comprehensive search across songs, playlists, and channels
- Offline playlist manager with download tracking
- Pre-built frontend for zero-build deployment
- Docker-based deployment with docker compose
- Material-UI dark theme interface
- YouTube audio download and management
- Multi-user authentication support
2025-12-16 23:43:07 +00:00

23 lines
624 B
Python

"""Common views"""
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.views import APIView
class ApiBaseView(APIView):
"""Base API view"""
pass
class AdminOnly(IsAdminUser):
"""Admin only permission"""
pass
class AdminWriteOnly(IsAuthenticated):
"""Allow all authenticated users to read and write their own data"""
def has_permission(self, request, view):
# All authenticated users can perform any action
# Data isolation is enforced at the view/queryset level via owner field
return request.user and request.user.is_authenticated