AccessPolicyContextUtils
The thing an AccessPolicy is handed when it runs. A named concept with a checked shape rather than an anonymous table, because a policy author reads this before they write anything, and "what do I get and what may I do with it" should be answerable in one place.
apply = function(context)
return context.observeFact(AccessFactNames.PLAYER_IS_ADMIN):Subscribe(function(isAdmin)
if isAdmin == false then
kick(context.player)
end
end)
end
observeFact and observeFeature refuse anything the policy did not declare, so what a readout says
a policy depends on is the whole truth about its inputs.
Properties
isAccessPolicyContext
AccessPolicyContextUtils.isAccessPolicyContext: (any) → (boolean,string?)Functions
create
Types
Builds a context, asserting its shape. Strict rather than lenient: a context missing a member fails here, where the message names it, instead of inside somebody's policy as a nil call.