privilege code working in Slice and Deployment
diff --git a/xos/tosca/resources/deployment.py b/xos/tosca/resources/deployment.py
index de7e46d..87b1926 100644
--- a/xos/tosca/resources/deployment.py
+++ b/xos/tosca/resources/deployment.py
@@ -8,7 +8,7 @@
sys.path.append("/opt/tosca")
from translator.toscalib.tosca_template import ToscaTemplate
-from core.models import User,Deployment,Image,ImageDeployments,Flavor
+from core.models import User,Deployment,DeploymentRole,DeploymentPrivilege,Image,ImageDeployments,Flavor
from xosresource import XOSResource
@@ -47,6 +47,9 @@
flavor.deployments.add(obj)
flavor.save()
+ rolemap = ( ("tosca.relationships.AdminPrivilege", "admin"), )
+ self.postprocess_privileges(DeploymentRole, DeploymentPrivilege, rolemap, obj, "deployment")
+
def delete(self, obj):
if obj.sites.exists():
self.info("Deployment %s has active sites; skipping delete" % obj.name)