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"]
raise ValidationError("Operation authorization \".\" should be True/False.")
if role_def[-1] == ":":
raise ValidationError("Operation cannot end with \".\"")
-
+
role_def_matches = [op for op in operations if op.startswith(role_def)]
if len(role_def_matches) == 0: