diff --git a/src/process.rs b/src/process.rs index 6362712..3abe6e6 100644 --- a/src/process.rs +++ b/src/process.rs @@ -118,7 +118,10 @@ impl ProcessState { // Collect applicable rules from all roles for the current field let applicable_roles: Vec = self.roles .iter() - .filter_map(|(_, role_def)| { + .filter_map(|(role_name, role_def)| { + // We allow for a special case with a role that works only for initial state + // That's optional though + if previous_state.is_some() && *role_name == crate::SpecialRoles::DEMIURGE.to_string() { return None; } let mut filtered_role_def = role_def.clone(); let rules = filtered_role_def.get_applicable_rules(field); filtered_role_def.validation_rules =