mirror of
https://github.com/MOIS3Y/logs-collector.git
synced 2025-02-01 17:30:52 +01:00
14 lines
396 B
Python
14 lines
396 B
Python
from rest_framework import permissions
|
|
|
|
|
|
class IsGuestUpload(permissions.BasePermission):
|
|
"""
|
|
Special permission class for the ability to upload attachments
|
|
to an unauthorized user using a ticket token
|
|
"""
|
|
def has_permission(self, request, view):
|
|
if request.method in ('HEAD', 'OPTIONS', 'POST',):
|
|
return True
|
|
|
|
return request.user.is_authenticated
|