syft-permissions is the core permission engine for SyftBox, providing an ACL (Access Control List) tree-based system for managing file and folder permissions on datasites.
Installation
For most use cases, you should use syft-perm instead, which provides a user-friendly API on top of this package.
When to Use
Usesyft-permissions when you need to:
- Build custom permission systems on top of the ACL engine
- Implement low-level permission checks
- Create permission rules and rulesets programmatically
- Extend the SyftBox permission system
Core Concepts
ACL Service
TheACLService is the core engine that processes permission requests against rulesets.
Access Levels
- READ: View file contents
- CREATE: Read + create new files in folders
- WRITE: Read + Create + modify existing files
- ADMIN: Read + Create + Write + manage permissions
RuleSet
ARuleSet is a collection of rules stored in syftperm.yaml files that define who can access what.
API Reference
Main Exports
Basic Usage
Creating a Permission Service
Making Permission Requests
Creating RuleSets
Working with Access Levels
Permission File Format
The permission system usessyftperm.yaml files:
Pattern Matching
The system uses glob patterns for matching paths:**/*.csv- All CSV files in any subdirectorypublic/**- Everything in the public folder*.json- All JSON files in current directorydata/*/results.csv- results.csv in any subdirectory of data
Advanced Usage
Custom Permission Logic
Dependencies
pydantic>=2.11.7- Data validation and modelspyyaml>=6.0- YAML file parsingwcmatch>=10.0- Advanced glob pattern matching
Related Packages
- syft-perm - User-friendly permission API (recommended for most users)