manifold:perms 0.2.0
Contract reference · Payloads · contract.json (crates/manifold-wasm-abi/wit/contract.json)
Contract 0.2.0, track 0.2: open, unreleased. Nothing on track 0.2 is released yet, so any item may still change in place (spec §7.2).
| Interface | Kind | Consent | Sides | Owner |
|---|---|---|---|---|
permissions | import | listed | both | enki |
Interface permissions
import · consent listed · sides both · owner enki · since 0.2.0
Named permissions and valued limits (Enki B §8.4, §8.7). Both sides;
consent class listed. The server answers for any connected player and
for this mod’s own mod-self actor; the client answers for its own
player from the set the server last sent it, for display and UI gating
only (the server enforces independently).
Queries of world state work inside the mod’s own systems, where the host
lends the world; outside one they fail with outside-system.
Functions
actor-has
actor-has: func(who: actor, node: string) -> result<bool, permission-error>
Whether who holds node: a player by its connection, mod-self by
the nodes this mod declares and lists in uses (§8.5).
declared
declared: func() -> declared-set
––––– both sides –––––
has
has: func(peer: u64, node: string) -> result<bool, permission-error>
level
level: func(peer: u64) -> result<permission-level, permission-error>
––––– server side, by connected peer –––––
limit
limit: func(peer: u64, name: string) -> result<option<s64>, permission-error>
None for an undeclared limit.
own-has
own-has: func(node: string) -> result<bool, permission-error>
own-level
own-level: func() -> result<permission-level, permission-error>
––––– client side: the local player’s own set –––––
own-limit
own-limit: func(name: string) -> result<option<s64>, permission-error>
Types
actor (alias)
= core/types.actor
declared-set (record)
What this mod declares (Enki B §8.2): its own nodes and limits and the names it uses, in declaration order.
| Field | Type | About |
|---|---|---|
nodes | list<string> | |
limits | list<string> | |
uses | list<string> |
permission-error (variant)
| Index | Case | Payload | About |
|---|---|---|---|
| 0 | unknown-peer | none | No connected player has this peer id. |
| 1 | wrong-side | none | |
| 2 | outside-system | none |
permission-level (alias)
= core/types.permission-level