mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-13 08:38:43 +03:00
lib/contact: fix +is-allowed, +get-contact
This commit is contained in:
parent
3dcd6395ac
commit
9f9cfc086c
@ -55,7 +55,7 @@
|
||||
|= [=path =resource:res]
|
||||
^- vase
|
||||
|^
|
||||
?> (is-allowed:con src.bowl)
|
||||
?> (is-allowed:con resource src.bowl)
|
||||
!> ^- update:store
|
||||
[%initial rolo %.n]
|
||||
::
|
||||
|
@ -40,32 +40,34 @@
|
||||
?. =(s our.bowl)
|
||||
rids
|
||||
(snoc rids [our.bowl %''])
|
||||
::
|
||||
++ scry-sharing
|
||||
.^ (set resource)
|
||||
%gx
|
||||
(scot %p our.bowl)
|
||||
%contact-push-hook
|
||||
(scot %da now.bowl)
|
||||
/sharing/noun
|
||||
==
|
||||
--
|
||||
++ scry-sharing
|
||||
.^ (set resource)
|
||||
%gx
|
||||
(scot %p our.bowl)
|
||||
%contact-push-hook
|
||||
(scot %da now.bowl)
|
||||
/sharing/noun
|
||||
==
|
||||
::
|
||||
++ get-contact
|
||||
|= =ship
|
||||
^- (unit contact:store)
|
||||
=/ upd (scry-for (unit update:store) /contact/(scot %p ship))
|
||||
?~ upd ~
|
||||
?> ?=(%add -.u.upd)
|
||||
`contact.u.upd
|
||||
=/ =rolodex:store
|
||||
(scry-for rolodex:store /all)
|
||||
(~(get by rolodex) ship)
|
||||
::
|
||||
++ is-allowed
|
||||
|= =ship
|
||||
|= [rid=resource =ship]
|
||||
^- ?
|
||||
=/ grp ~(. group bowl)
|
||||
=/ shp (scry-for ? /allowed-ship/(scot %p ship))
|
||||
?: shp %.y
|
||||
?: ?& (~(has in scry-sharing) rid)
|
||||
(~(has in (members:grp rid)) ship)
|
||||
==
|
||||
%.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)
|
||||
|
Loading…
Reference in New Issue
Block a user