Skip to main content

Module share

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 under resource:*: item ids are unique, so the node stays one item. A bare resource:* 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§

ShareAccess
What a share lets the workspace do with the resource.
ShareRefusal
Why a share cannot be made.

Functions§

check_held
Whether sharer, deciding as actor, holds everything each of grants gives on its node.
is_of_share
Whether grant is one of the share share’s.
share_grants
The grants sharer gives the workspace workspace by sharing node with access, under the share id share (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.