readonly checking in tenant view
diff --git a/planetstack/core/plus/views.py b/planetstack/core/plus/views.py
index 2fcef20..f57f587 100644
--- a/planetstack/core/plus/views.py
+++ b/planetstack/core/plus/views.py
@@ -157,6 +157,9 @@
class TenantCreateSlice(View):
def post(self, request, *args, **kwargs):
+ if request.user.isReadOnlyUser():
+ return HttpResponseForbidden("User is in read-only mode")
+
sliceName = request.POST.get("sliceName", "0")
serviceClass = request.POST.get("serviceClass", "0")
imageName = request.POST.get("imageName", "0")
@@ -190,6 +193,9 @@
class TenantUpdateSlice(View):
def post(self, request, *args, **kwargs):
+ if request.user.isReadOnlyUser():
+ return HttpResponseForbidden("User is in read-only mode")
+
sliceName = request.POST.get("sliceName", "0")
serviceClass = request.POST.get("serviceClass", "0")
imageName = request.POST.get("imageName", "0")
@@ -637,6 +643,8 @@
class TenantDeleteSliceView(View):
def post(self,request):
+ if request.user.isReadOnlyUser():
+ return HttpResponseForbidden("User is in read-only mode")
sliceName = request.POST.get("sliceName",None)
slice = Slice.objects.get(name=sliceName)
#print slice, slice.id