+ config["message"]["driver"]))
+ if not self.auth:
+ if config["authentication"]["backend"] == "keystone":
+ self.auth = AuthconnKeystone(config["authentication"], self.db, None)
+ else:
+ self.auth = AuthconnInternal(config["authentication"], self.db, dict())
+ if not self.operations:
+ if "resources_to_operations" in config["rbac"]:
+ resources_to_operations_file = config["rbac"]["resources_to_operations"]
+ else:
+ possible_paths = (
+ __file__[:__file__.rfind("engine.py")] + "resources_to_operations.yml",
+ "./resources_to_operations.yml"
+ )
+ for config_file in possible_paths:
+ if path.isfile(config_file):
+ resources_to_operations_file = config_file
+ break
+ 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, Loader=yaml.Loader)
+
+ self.operations = []
+
+ for _, value in resources_to_operations["resources_to_operations"].items():
+ if value not in self.operations:
+ self.operations += [value]