mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
54 lines
1.0 KiB
Plaintext
54 lines
1.0 KiB
Plaintext
|
:: metadata: helpers for getting data from the metadata-store
|
||
|
::
|
||
|
/- *metadata-store
|
||
|
::
|
||
|
|_ =bowl:gall
|
||
|
++ app-paths-from-group
|
||
|
|= [=app-name =group-path]
|
||
|
^- (list app-path)
|
||
|
%+ murn
|
||
|
%~ tap in
|
||
|
=- (~(gut by -) group-path ~)
|
||
|
.^ (jug ^group-path resource)
|
||
|
%gy
|
||
|
(scot %p our.bowl)
|
||
|
%metadata-store
|
||
|
(scot %da now.bowl)
|
||
|
/group-indices
|
||
|
==
|
||
|
|= =resource
|
||
|
^- (unit app-path)
|
||
|
?. =(app-name.resource app-name) ~
|
||
|
`app-path.resource
|
||
|
::
|
||
|
++ groups-from-resource
|
||
|
|= =resource
|
||
|
^- (list group-path)
|
||
|
=; resources
|
||
|
%~ tap in
|
||
|
%+ ~(gut by resources)
|
||
|
resource
|
||
|
*(set group-path)
|
||
|
.^ (jug ^resource group-path)
|
||
|
%gy
|
||
|
(scot %p our.bowl)
|
||
|
%metadata-store
|
||
|
(scot %da now.bowl)
|
||
|
/resource-indices
|
||
|
==
|
||
|
::
|
||
|
++ check-resource-permissions
|
||
|
|= [=ship =resource]
|
||
|
^- ?
|
||
|
%+ lien (groups-from-resource resource)
|
||
|
|= =group-path
|
||
|
.^ ?
|
||
|
%gx
|
||
|
(scot %p our.bowl)
|
||
|
%permission-store
|
||
|
(scot %da now.bowl)
|
||
|
%permitted
|
||
|
(scot %p ship)
|
||
|
(snoc group-path %noun)
|
||
|
==
|
||
|
--
|