fn set_grant_on_email(
state: &AppState,
agent_id: &str,
(chosen, same_email): (&IdentityAccount, &[&IdentityAccount]),
service: Service,
level: Option<GrantLevel>,
now: i64,
) -> Result<(), String>Expand description
Set an agent’s grant on chosen, one of the connections of an email (same_email, all of them). The agent
names an email, so one grant per email: the service is cleared on the email’s other connections, or an
ungrant (or a change of level) would leave an older grant usable.