only admins can save/update controllers
diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py
index 29cecfd..8c9e050 100644
--- a/planetstack/core/admin.py
+++ b/planetstack/core/admin.py
@@ -742,6 +742,13 @@
return AdminFormMetaClass
+ def save_model(self, request, obj, form, change):
+ # update openstack connection to use this site/tenant
+ obj.save_by_user(request.user)
+
+ def delete_model(self, request, obj):
+ obj.delete_by_user(request.user)
+
class ServiceAttrAsTabInline(PlStackTabularInline):
model = ServiceAttribute
fields = ['name','value']
diff --git a/planetstack/core/models/site.py b/planetstack/core/models/site.py
index 4b42815..67b77f5 100644
--- a/planetstack/core/models/site.py
+++ b/planetstack/core/models/site.py
@@ -278,6 +278,13 @@
def __unicode__(self): return u'%s %s %s' % (self.name, self.backend_type, self.version)
+ def can_update(self, user):
+ if user.is_readonly:
+ return False
+ if user.is_admin:
+ return True
+ return False
+
class SiteDeployment(PlCoreBase):
objects = ControllerLinkManager()
deleted_objects = ControllerLinkDeletionManager()