Module share
Expand description
Sharing one resource with a workspace: the grants a share is.
A person who shares something they work on (a note shown live in a chat
channel) lets the workspace’s members see it, or also change it. That is not
a promise kept by the sharing app: a share is grants on the shared
resource’s own node, decided by crate::decide at every door and by
every receiver like any other grant, and revoked when the share ends.
- One resource. A share names one record
(
workspace › app › kind › resource) or one item of it (… › resource › item). An app’s own record of the workspace travels under an empty route that a node cannot name, so an item of it is named underresource:*: item ids are unique, so the node stays one item. A bareresource:*would be every record of the kind and is refused. - Everyone in the workspace below the owner. A grant per role preset, Viewer to Moderator: Read for a view share, Read and Undoable for an edit share. A grant covers only the kinds it names, so a view share strips no one: an Editor’s Undoable on the shared item is still decided by their role’s grant on the workspace.
- Never more than the sharer holds. Each grant is bounded by the
sharer’s own holdings on its node (
check_held), so a Viewer cannot hand out edit. - Never past a decision about a person. A share grants roles, and a
sharer may not lift a ban or a restriction, so neither does the share:
a person’s ban or restriction holds over every grant to their role,
however specific (
crate::Party::held_off).
Enums§
- Share
Access - What a share lets the workspace do with the resource.
- Share
Refusal - Why a share cannot be made.
Functions§
- check_
held - Whether
sharer, deciding asactor, holds everything each ofgrantsgives on its node. - is_
of_ share - Whether
grantis one of the shareshare’s. - share_
grants - The grants
sharergives the workspaceworkspaceby sharingnodewithaccess, under the share idshare(unique per share, such as the id of the message that shares it). - share_
id_ prefix - The start of the id of every grant of the share
share.