use crate::{AccountId, ContentDirectoryWorkingGroupInstance, MemberId, Runtime}; // Alias for content directory working group pub(crate) type ContentDirectoryWorkingGroup = working_group::Module; impl content_directory::ActorAuthenticator for Runtime { type CuratorId = u64; type MemberId = MemberId; type CuratorGroupId = u64; fn is_lead(account_id: &AccountId) -> bool { // get current lead id let maybe_current_lead_id = ContentDirectoryWorkingGroup::::current_lead(); if let Some(ref current_lead_id) = maybe_current_lead_id { if let Ok(worker) = ContentDirectoryWorkingGroup::::ensure_worker_exists(current_lead_id) { *account_id == worker.role_account_id } else { false } } else { false } } fn is_curator(curator_id: &Self::CuratorId, account_id: &AccountId) -> bool { if let Ok(worker) = ContentDirectoryWorkingGroup::::ensure_worker_exists(curator_id) { *account_id == worker.role_account_id } else { false } } fn is_member(member_id: &Self::MemberId, account_id: &AccountId) -> bool { membership::Module::::ensure_is_controller_account_for_member( member_id, account_id, ) .is_ok() } }