use std::sync::Arc;
use tracing::debug;
use crate::control::security::catalog::StoredContinuousAggregate;
use crate::control::security::catalog::auth_types::object_type;
use crate::control::state::SharedState;
pub fn put(stored: StoredContinuousAggregate, shared: Arc<SharedState>) {
debug!(
cagg = %stored.name,
tenant = stored.tenant_id,
"catalog_entry: continuous aggregate upserted"
);
super::owner::install_from_parent(
object_type::CONTINUOUS_AGGREGATE,
stored.tenant_id,
&stored.name,
&stored.owner,
&shared,
);
}
pub fn delete(tenant_id: u64, name: String, shared: Arc<SharedState>) {
debug!(
cagg = %name,
tenant = tenant_id,
"catalog_entry: continuous aggregate removed"
);
shared.permissions.install_replicated_remove_owner(
object_type::CONTINUOUS_AGGREGATE,
tenant_id,
&name,
);
}