Django/DRF + PostgreSQL/Redis/Celery backend with accounts, library, moments, and notifications apps; React/TypeScript/Vite frontend with Instagram-style sidebar nav, feed, profiles, nested comment replies, notifications, and photo/video upload with ffmpeg-generated posters. Co-Authored-By: Claude Sonnet 5 <[email protected]>
11 lines
414 B
Python
11 lines
414 B
Python
from rest_framework.permissions import BasePermission
|
|
|
|
|
|
class IsOwner(BasePermission):
|
|
"""Library items and albums are private by default — only the owner may
|
|
read or write them through these endpoints. Sharing happens explicitly
|
|
via Moments / AlbumCollaborators, handled by their own views."""
|
|
|
|
def has_object_permission(self, request, view, obj):
|
|
return obj.owner_id == request.user.id
|