self.format_on_new(content, session["project_id"], make_public=session["public"])
_id = self.auth.create_user(content["username"], content["password"])["_id"]
- for mapping in content["project_role_mappings"]:
- self.auth.assign_role_to_user(_id, mapping["project"], mapping["role"])
+ if "project_role_mappings" in content.keys():
+ for mapping in content["project_role_mappings"]:
+ self.auth.assign_role_to_user(_id, mapping["project"], mapping["role"])
rollback.append({"topic": self.topic, "_id": _id})
del content["password"]
if path.isfile(config_file):
resources_to_operations_file = config_file
break
- if not resources_to_operations_file:
+ if not resources_to_operations_file:
raise EngineException("Invalid permission configuration: resources_to_operations file missing")
-
+
with open(resources_to_operations_file, 'r') as f:
resources_to_operations = yaml.load(f)
-
+
self.operations = []
for _, value in resources_to_operations["resources_to_operations"].items():