1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Account-level capabilities (entitlements) shared across services.
//!
//! Distinct from API-key [`crate::permissions`] (per key) and roles (operational). A user is
//! granted a default set at registration; the platform admin can restrict/grant per user. The
//! effective set is computed in the identity service and propagated to every service as the
//! signed `x-auth-capabilities` header; enforcement is per-endpoint via
//! [`crate::UserContext::require_capability`].
/// Read account data (balances / orders / history).
pub const ACCOUNT_READ: &str = "account.read";
/// Place / cancel spot orders.
pub const SPOT_TRADE: &str = "spot.trade";
/// Crypto deposits.
pub const DEPOSIT_CRYPTO: &str = "deposit.crypto";
/// Crypto withdrawals.
pub const WITHDRAW_CRYPTO: &str = "withdraw.crypto";
/// Internal transfers.
pub const TRANSFER_INTERNAL: &str = "transfer.internal";
/// Create / use API keys.
pub const API_ACCESS: &str = "api.access";
/// Fiat deposits.
pub const FIAT_DEPOSIT: &str = "fiat.deposit";
/// Fiat withdrawals.
pub const FIAT_WITHDRAW: &str = "fiat.withdraw";
/// Every known capability, in canonical order.
pub const ALL: & = &;
/// Capabilities granted to every user at registration. Several of these (see the
/// consuming service's KYC gate) are still hard-blocked until KYC clears — being
/// "default on" only means no admin action is required once it does.
pub const DEFAULT_ON: & = &;
/// True when `cap` is a recognized capability.
/// True when `cap` is on by default at registration.