Skip to main content

can_view_item

Function can_view_item 

Source
pub fn can_view_item(
    subject_id_tag: &str,
    is_authenticated: bool,
    item_owner_id_tag: &str,
    tenant_id_tag: &str,
    visibility: Option<char>,
    subject_following_owner: bool,
    subject_connected_to_owner: bool,
    audience_tags: Option<&[&str]>,
) -> bool
Expand description

Check if subject can view an item based on visibility and relationship

This is a standalone function for use in list filtering where we don’t have full ABAC context. It evaluates visibility rules directly.

§Arguments

  • subject_id_tag - The viewer’s id_tag (empty string for anonymous)
  • is_authenticated - Whether the subject is authenticated
  • item_owner_id_tag - The item owner/issuer’s id_tag
  • tenant_id_tag - The tenant’s id_tag (owner of the node where item is stored)
  • visibility - The item’s visibility level (None = Direct)
  • subject_following_owner - Whether the subject follows the owner
  • subject_connected_to_owner - Whether the subject is connected to owner
  • audience_tags - Optional list of audience id_tags (for Direct visibility)