def scope_grant

bendvy-ecs-core@0.1.0.3 · execution_command_permission.bend:122

import bendvy-ecs-core@0.1.0.3/execution_command_permission.bend as ExecutionCommandPermission
import Base
import bendvy-ecs-core@0.1.0.3/execution_composer_layout.bend as Layout
import bendvy-ecs-core@0.1.0.3/execution_resource_policy.bend as Policy
import bendvy-ecs-core@0.1.0.3/execution_lifetime_scope_store.bend as ScopeStore
import bendvy-ecs-core@0.1.0.3/execution_lifetime_scope_command.bend as ScopeCommands

122def scope_grant(~S:Data,~layout:Layout.Layout,~resources:Layout.Layout,~Q:Type,~enqueue:Q -> Layout.Route -> ScopeCommands.Operation<S> -> Q,~route:Layout.Route,~valid:{Layout.grant_valid(~resources,~route) == True{} : Bool},~payload:{Layout.payload(resources,route) == ScopeStore.Store<S> : Type},~view:{Layout.view(resources,route) == ScopeStore.View<S> : Data},~protected:{Layout.policy(resources,route) == Policy.ProtectedLifetimeScope{S} : Policy.Policy},book:Book<S,layout,resources>) -> Book<S,layout,resources> & ScopeCommands.Commands<Q,S>:
123  match book:
124    case Book{_,relations,selection}:(Book{EntityStructural{},ScopeAllowed{route,valid,payload,view,protected,relations},extend_scope_selection(~S,~resources,~route,~valid,~payload,~view,~protected,selection)},ScopeCommands.provide(~S,~Q,~route,~enqueue))

Uses (19)

Used by (1)