fix bugs
[plstackapi.git] / plstackapi / core / models / site.py
index b15e35b..76cc0a4 100644 (file)
@@ -26,6 +26,9 @@ class Site(PlCoreBase):
                                                description=self.name, 
                                                enabled=self.enabled)
             self.tenant_id = tenant.id
+            # give caller an admin role at the tenant they've created
+            self.driver.add_user_role(self.caller.user_id, tenant.id, 'admin')
+             
         # update the record
         if self.id:
             self.driver.update_tenant(self.tenant_id,