contact: perfected the +is-allowed arm and fixed issue with share type

This commit is contained in:
Logan Allen 2021-02-02 19:13:33 -06:00
parent fe76d75a18
commit 02f4ff58a1
4 changed files with 28 additions and 9 deletions

View File

@ -219,8 +219,12 @@
``noun+!>(allowed-groups)
::
[%x %is-allowed @ @ @ ~]
=/ =resource [(slav %p i.t.t.path) i.t.t.t.path]
[%x %is-allowed @ @ @ @ ~]
=/ is-personal =(i.t.t.t.t.t.path 'true')
=/ =resource
?: is-personal
[our.bowl %'']
[(slav %p i.t.t.path) i.t.t.t.path]
=/ =ship (slav %p i.t.t.t.t.path)
``json+!>(`json`b+(is-allowed:con resource ship))
==

View File

@ -175,6 +175,10 @@
%share-co
?> ?=(%poke-ack -.sign)
(ack +.sign)
::
%push-co
?> ?=(%poke-ack -.sign)
(ack +.sign)
::
%md
?+ -.sign !!
@ -200,6 +204,7 @@
%- zing
:~ [(poke-our:(jn-pass-io /pull-md) %metadata-pull-hook cag)]~
[(poke-our:(jn-pass-io /pull-co) %contact-pull-hook cag)]~
::
?. scry-is-public:con ~
:_ ~
%+ poke:(jn-pass-io /share-co)

View File

@ -76,14 +76,24 @@
:: this is used for direct messages and leap searches
::
?& =(rid [our.bowl %''])
?| scry-is-public
?| :: if our profile is public, allow
::
scry-is-public
:: if the requester is an allowed-ship, allow
::
(scry-for ? /allowed-ship/(scot %p ship))
:: if the requester of our profile is the host of one of
:: our allowed-groups, allow
::
%+ lien ~(tap in allowed-groups)
|= res=resource
=(entity.res ship)
== ==
:: if they are requesting our profile within a group, make sure we
:: are the host of that group and that they are a member of the group
:: if they are requesting our contact data within a group,
:: we make sure that we are sharing that group,
:: and that they are a member of the group
::
?& (~(has in allowed-groups) rid)
(~(has in scry-sharing) rid)
?& (~(has in scry-sharing) rid)
(~(has in (members:grp rid)) ship)
== ==
== ==
--

View File

@ -9,7 +9,7 @@
::
++ grab
|%
++ noun share
++ noun _share
++ json share:share-dejs
--
--