Skip to main content

Module file_access

Module file_access 

Source
Expand description

File access level helpers

Provides functions to determine user access levels to files based on:

  • Scoped tokens (file:{file_id}:{R|W} grants Read/Write access)
  • Ownership (owner always has Write access)
  • FSHR action grants (WRITE subtype = Write, otherwise Read)

Structs§

FileAccessCtx
Context describing the subject requesting file access
FileAccessResult
Result of checking file access

Enums§

FileAccessError
Error type for file access checks
ScopeCheck
Result of checking whether a file is allowed by scope

Functions§

check_file_access_with_scope
Check file access and return file view with access level
check_scope_allows_create
Check if a scoped token allows write access for file creation.
check_scope_allows_file
Check if a file operation is allowed by scope.
check_share_for_file
Check if a user has share access to a file — either a direct share entry on the file itself or an inherited share from an ancestor folder.
get_access_level
Get access level for a user on a file
get_access_level_with_scope
Get access level for a user on a file, considering scoped tokens
walk_parent_chain_for_share
Walk the parent chain of a file to find an inherited share entry.