def relation_grant

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

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_relation_store.bend as RelationStore
import bendvy-ecs-core@0.1.0.3/relation_types.bend as Relation
import bendvy-ecs-core@0.1.0.3/execution_relation_command.bend as RelationCommands
import bendvy-ecs-core@0.1.0.3/execution_relation_operation.bend as Operation

117def relation_grant(~S:Data,~layout:Layout.Layout,~resources:Layout.Layout,~Q:Type,~enqueue:Q -> Layout.Route -> Operation.Operation<S> -> Q,~route:Layout.Route,~valid:{Layout.grant_valid(~resources,~route) == True{} : Bool},~descriptor:Relation.Descriptor<S>,~payload:{Layout.payload(resources,route) == RelationStore.Store<S,descriptor> : Type},~view:{Layout.view(resources,route) == RelationStore.View<S,descriptor> : Data},~protected:{Layout.policy(resources,route) == Policy.ProtectedRelation{S,descriptor} : Policy.Policy},book:Book<S,layout,resources>) -> Book<S,layout,resources> & RelationCommands.HierarchyCommands<Q,S>:
118  match book:
119    case Book{permission,relations,selection}:(Book{permission,RelationAllowed{route,valid,descriptor,payload,view,protected,relations},extend_selection(~S,~resources,~route,~valid,~descriptor,~payload,~view,~protected,selection)},RelationCommands.hierarchy(~S,~Q,~route,~enqueue))

Uses (19)

Used by (1)