OxL Reference

method DynHandle.unsetAs

Removes the override of layer on behalf of p.

Example:

oxl✓ checked in CI
dynamic Limits {
  rps: u32 = 100
}

policy Limits {
  allow set if caller.hasRole("Admin")
}

fn main() io {
  let l = Limits.get()
  let admin = Principal.User("ann", ["Admin"], Map.new(), false, none)
  l.rps.setAs(&admin, 7)!
  l.rps.unsetAs(&admin)!
  print("{l.rps.get()}")
}
Output
100
pub(api) fn unsetAs(p: &Principal, layer: DynScope = .Global) -> () | DynError

Since. 1.0.0-beta

Parameters

NameType
p&Principal
layerDynScope = .Global

Returns

()

Errors

  • DynError @error
  • `DynError` when the policy of the config refuses `p`.

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/dynconf.oxl:686

See also