Watch
0
0
Fork
You've already forked hyperhive
0

hive-sh4re: split manager-socket constants + HelperEvent into their own topic module

This commit is contained in:
damocles 2026-08-10 22:38:35 +02:00 • committed by mara
commit 138f6b6c10

View file

@ -165,13 +165,15 @@ impl OperatorQuestions {
// can additionally override agent-to-agent questions to close
// stuck threads).
let authorised = match target.as_deref() {
None => answerer == hive_sh4re::OPERATOR_RECIPIENT,
Some(t) => answerer == t || answerer == hive_sh4re::OPERATOR_RECIPIENT,
None => answerer == hive_sh4re::manager::OPERATOR_RECIPIENT,
Some(t) => answerer == t || answerer == hive_sh4re::manager::OPERATOR_RECIPIENT,
};
if !authorised {
bail!(
"question {id} not addressed to '{answerer}' (target = {:?})",
target.as_deref().unwrap_or(hive_sh4re::OPERATOR_RECIPIENT)
target
.as_deref()
.unwrap_or(hive_sh4re::manager::OPERATOR_RECIPIENT)
);
}
conn.execute(
@ -216,8 +218,9 @@ impl OperatorQuestions {
if answered_at.is_some() {
bail!("question {id} already answered/cancelled");
}
let authorised =
privileged || canceller == asker || canceller == hive_sh4re::OPERATOR_RECIPIENT;
let authorised = privileged
|| canceller == asker
|| canceller == hive_sh4re::manager::OPERATOR_RECIPIENT;
if !authorised {
bail!("question {id}: '{canceller}' not allowed to cancel (asker = '{asker}')");
}