roles_integrity/
admins.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use hdi::prelude::*;
use roles_types::{
    validate_agent_had_undeleted_role_claim_at_the_time_with_zome_index, ADMIN_ROLE,
};

///Validating that the Agent had a claim of the ADMIN_ROLE in their source chain prior to some action
pub fn validate_agent_was_admin_at_the_time(
    agent: &AgentPubKey,
    chain_top: &ActionHash,
) -> ExternResult<ValidateCallbackResult> {
    validate_agent_had_undeleted_role_claim_at_the_time_with_zome_index(
        agent,
        chain_top,
        &ADMIN_ROLE.to_string(),
        zome_info()?.id,
    )
}