mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 08:34:25 +03:00
35 lines
729 B
Plaintext
35 lines
729 B
Plaintext
/- store=contact-store, *resource
|
|
/+ group
|
|
|_ =bowl:gall
|
|
++ scry-for
|
|
|* [=mold =path]
|
|
.^ mold
|
|
%gx
|
|
(scot %p our.bowl)
|
|
%contact-store
|
|
(scot %da now.bowl)
|
|
(snoc `^path`path %noun)
|
|
==
|
|
::
|
|
++ get-contact
|
|
|= =ship
|
|
^- (unit contact:store)
|
|
=/ upd (scry-for (unit update:store) /contact/(scot %p ship))
|
|
?~ upd ~
|
|
?> ?=(%add -.u.upd)
|
|
`contact.u.upd
|
|
::
|
|
++ is-allowed
|
|
|= =ship
|
|
^- ?
|
|
=/ shp (scry-for ? /allowed-ship/(scot %p ship))
|
|
?: shp %.y
|
|
=/ allowed-groups ~(tap in (scry-for (set resource) /allowed-groups))
|
|
=/ grp ~(. group bowl)
|
|
|-
|
|
?~ allowed-groups %.n
|
|
?: (~(has in (members:grp i.allowed-groups)) ship)
|
|
%.y
|
|
$(allowed-groups t.allowed-groups)
|
|
--
|