- if len(operation) != 1 and operation[-1] == ":":
- self.logger.warning("Invalid operation {0} terminated in ':'. "
- "Operation will be discarded"
- .format(operation))
- continue
-
- if operation not in role_ops.keys():
- role_ops[operation] = is_allowed
- else:
- self.logger.info("In role {0}, the operation {1} with the value {2} was discarded due to "
- "repetition.".format(role_with_operations["role"], operation, is_allowed))
-
- if not root:
- root = False
- self.logger.info("Root for role {0} not defined. Default value 'False' applied."
- .format(role_with_operations["role"]))
+ if "default" not in role_with_operations["permissions"]:
+ role_with_operations["permissions"]["default"] = False
+ if "admin" not in role_with_operations["permissions"]:
+ role_with_operations["permissions"]["admin"] = False