forked from uncloud/uncloud
phase in vpn
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
8fb3ad7fe8
commit
5d084a5716
11 changed files with 190 additions and 116 deletions
|
|
@ -1,3 +1,19 @@
|
|||
from django.shortcuts import render
|
||||
from rest_framework import viewsets, permissions
|
||||
|
||||
# Create your views here.
|
||||
|
||||
from .models import *
|
||||
from .serializers import *
|
||||
|
||||
|
||||
class VPNProductViewSet(viewsets.ModelViewSet):
|
||||
serializer_class = VPNProductSerializer
|
||||
permission_classes = [permissions.IsAdminUser]
|
||||
|
||||
def get_queryset(self):
|
||||
if self.request.user.is_superuser:
|
||||
obj = VPNProduct.objects.all()
|
||||
else:
|
||||
obj = VPNProduct.objects.filter(owner=self.request.user)
|
||||
|
||||
return obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue