OxL Reference

method Principal.isUser

The caller is a user; with id it must be that user (none -> false).

Example:

oxl✓ checked in CI
fn main() io {
  let ann = Principal.User("ann", [], Map.new(), false, none)
  print("{ann.isUser(none)} {ann.isUser("ann")} {ann.isUser("bob")} {Principal.Anonymous.isUser(none)}")
}
Output
false true false false
pub(api) fn isUser(id: str?) -> bool

Complexity. O(1).

Since. 1.0.0-beta

Parameters

NameType
idstr?

Returns

bool

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/rpc.oxl:76

See also