mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
35 lines
716 B
Plaintext
35 lines
716 B
Plaintext
/- store=contact-store
|
|
/+ 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)
|
|
--
|