add :ask|admins dynamic permissions

This commit is contained in:
Anton Dyudin 2016-08-19 17:00:24 -07:00
parent 98fe86fb49
commit b26ee30990
2 changed files with 26 additions and 2 deletions

View File

@ -13,7 +13,12 @@
++ email @t
--
!:
|_ {bow/bowl adr/(map email {time invited}) sos/(map bone sole-share) wom/(unit ship)}
|_ $: bow/bowl
adr/(map email {time invited})
sos/(map bone sole-share)
wom/(unit ship)
admins/(set ship)
==
++ prompt
^- sole-prompt
?~ wom [& %ask-ship ":womb-ship? ~"]
@ -25,7 +30,7 @@
|= path
^- (quip {bone card} +>)
~| [%not-in-whitelist src.bow]
?> (~(has in (sy ~zod our.bow ~wisdyr-holpeg ~)) src.bow)
?> |((~(has in admins) src.bow) =(our.bow src.bow))
:_ +>.$(sos (~(put by sos) ost.bow *sole-share))
=- [(effect %mor pro+prompt -)]~
=+ all=adrs
@ -56,6 +61,11 @@
;~(plug (cook crip (star next)) (easy ~))
==
::
++ poke-ask-admins
|= a/(set ship)
?> =(our.bow src.bow)
`+>.$(admins a)
::
++ poke-ask-mail
|= ask/@t
^- (quip {bone card} +>)

14
gen/ask/admins.hoon Normal file
View File

@ -0,0 +1,14 @@
::
:::: /hoon/release/hood/gen
::
/? 310
::
::::
!:
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{who/(list ship) $~}
==
:- %ask-admins ^- (set ship)
~? =(~ who) %admins-unset
(silt who)