Created
August 14, 2019 18:47
-
-
Save tacryt-socryp/13568cde42434320e739cea9491daa10 to your computer and use it in GitHub Desktop.
UP: Userspace architecture example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: hooks/associate-groups-permissions.hoon | |
|% | |
+$ state | |
$% [%0 state-zero] | |
== | |
:: | |
+$ group-path path | |
+$ permission-path path | |
:: | |
+$ state-zero | |
$: assocation=(map group-path (set permission-path)) | |
== | |
:: | |
+$ association-action | |
$% $: %associate | |
=group-path | |
permission-paths=(set permission-path) | |
=permission | |
== | |
$: %dissociate | |
=group-path | |
permission-paths=(set permission-path) | |
== | |
== | |
:: | |
-- | |
:: | |
|_ [bol=bowl:gall state] | |
:: | |
++ this . | |
:: | |
:: +peek | |
:: /permissions/:pax (pax is optional, if ~ receive set of keys) | |
:: /affiliation/:ship | |
:: | |
++ peek . | |
:: | |
++ poke-association-action | |
:: | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: service/groups.hoon | |
|% | |
+$ state | |
$% [%0 state-zero] | |
== | |
:: | |
+$ state-zero | |
$: groups=(map @tas group) | |
member=(map ship (set path)) | |
== | |
:: | |
+$ group | |
$% [%members members=(set ship)] | |
[%subgroups groups=(map @tas group)] | |
== | |
:: | |
+$ group-action | |
$% [%add member=(set ship) group=path] | |
[%remove member=(set ship) group=path] | |
[%bundle group=path] | |
[%unbundle group=path] | |
== | |
:: | |
+$ group-diff | |
$% [%add member=(set ship) group=path] | |
[%remove member=(set ship) group=path] | |
[%bundle group=path] | |
[%unbundle group=path] | |
== | |
:: | |
-- | |
:: | |
|_ [bol=bowl:gall state] | |
:: | |
++ this . | |
:: | |
:: +peek | |
:: /groups/:pax (pax is optional, if ~ receive set of keys) | |
:: /member/:ship | |
:: | |
:: | |
++ peek . | |
:: | |
++ poke-group-action | |
:: | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: service/permissions.hoon | |
|% | |
+$ state | |
$% [%0 state-zero] | |
== | |
:: | |
+$ permission | |
$% [%white (set ship)] | |
[%black (set ship)] | |
== | |
:: | |
+$ state-zero | |
$: permissions=(map path permission) | |
affiliation=(map ship (set path)) | |
== | |
:: | |
+$ permission-action | |
$% [%create pax=path =permission] | |
[%add pax=path ships=(set ship)] | |
[%remove pax=path ships=(set ship)] | |
[%allow pax=path ships=(set ship)] | |
[%deny pax=path ships(set ship)] | |
[%delete pax=path] | |
== | |
:: | |
-- | |
:: | |
|_ [bol=bowl:gall state] | |
:: | |
++ this . | |
:: | |
:: +peek | |
:: /permissions/:pax (pax is optional, if ~ receive set of keys) | |
:: /affiliation/:ship | |
:: | |
++ peek . | |
:: | |
++ poke-permission-action | |
:: | |
-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment