added api/pk/satellite, authorisation endpointsm, pagination
This commit is contained in:
parent
cc5187c3a1
commit
8225b18a2a
16 changed files with 284 additions and 26 deletions
8
api/permissions.py
Normal file
8
api/permissions.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from rest_framework.permissions import BasePermission, SAFE_METHODS
|
||||
|
||||
class ReadOnlyOrAuthenticated(BasePermission):
|
||||
def has_permission(self, request, view):
|
||||
return (
|
||||
request.method in SAFE_METHODS or
|
||||
request.user and request.user.is_authenticated
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue