- 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)
-
- self.operations = []
-
- for _, value in resources_to_operations["resources_to_operations"].items():
- if value not in self.operations:
- self.operations += value
-
- if config["authentication"]["backend"] == "keystone":
- self.map_from_topic_to_class["users"] = UserTopicAuth
- self.map_from_topic_to_class["projects"] = ProjectTopicAuth
- self.map_from_topic_to_class["roles"] = RoleTopicAuth
+ self.authconn = AuthconnInternal(config["authentication"], self.db,
+ self.authenticator.role_permissions)
+ # 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]