canic-core 0.25.2

Canic β€” a canister orchestration and management toolkit for the Internet Computer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Pool authority policy:
// - answers β€œis the caller authorized to perform pool admin operations?”
// - side-effect free
// - does not log / mutate / schedule

use crate::domain::policy::pool::PoolPolicyError;

/// Require that the caller is authorized to perform pool admin operations.
///
/// Current policy: root-only.
pub const fn require_pool_admin(is_root: bool) -> Result<(), PoolPolicyError> {
    if is_root {
        Ok(())
    } else {
        Err(PoolPolicyError::NotAuthorized)
    }
}