Every permission in syft-perm has a clear reason. This guide explains each one with visual examples.
Higher permission levels include all lower levels:
The user owns the datasite or is in the ownership path
admin access to all files in her datasite alice@example.com/ because she is the owner.
This reason appears when:
Direct permission grant in a YAML file
# In ~/SyftBox/datasites/alice@example.com/syft.pub.yaml
rules:
- pattern: 'research/data.csv'
access:
read:
- 'bob@example.com'
- pattern: 'research/analysis.py'
access:
write:
- 'carol@example.com'
data.csv
File matches a glob pattern in permission rules
*.csv
│ ├── experiment2.csv ✓ Matches *.csv
│ └── notes.txt
└── code/
├── main.py ✓ Matches **/*.py
└── utils/
└── helper.py ✓ Matches **/*.pyrules:
- pattern: '*.csv' # Matches CSV files in root
access:
read:
- 'data-team@example.com'
- pattern: '**/*.py' # Matches Python files anywhere
access:
write:
- 'dev-team@example.com'
Common patterns:
* - Matches any characters (except /)** - Matches any characters (including /)*.csv - All CSV files in current directory**/*.csv - All CSV files in any subdirectorydata/* - Everything in the data folder**/* - Everything recursivelyPermission inherited from a higher access level
rules:
- pattern: 'project/*'
access:
write: # Write includes read automatically
- 'bob@example.com'
write permission on project files. He automatically gets read access with the reason "Included via write permission in /alice@example.com/syft.pub.yaml"
Admin access includes Write, Create, and Read. Write access includes Create and Read. Create access includes Read.
No specific rule found, using closest parent's permissions
# In ~/SyftBox/datasites/alice@example.com/research/syft.pub.yaml
rules:
- pattern: '**/*' # Applies to all subdirectories
access:
read:
- 'research-team@example.com'
2024/january/ inherit permissions from research/syft.pub.yaml because there's no closer YAML file defining permissions.
File is accessible to everyone
rules:
- pattern: 'public/*'
access:
read:
- '*' # Asterisk means everyone
- pattern: 'guestbook.txt'
access:
write:
- '*' # Anyone can write
Use public access (*) carefully. It grants access to anyone with a SyftBox account.
Permission added through the UI or API
This reason appears when:
file.grant_read_access("user@example.com") in PythonWhy a user doesn't have access
When a permission check returns granted: false, you might see:
# User bob@example.com has read but wants write access
rules:
- pattern: 'data.csv'
access:
read:
- 'bob@example.com'
write:
- 'alice@example.com' # Bob not included
Other reasons you might encounter
syft-perm searches for syft.pub.yaml files in this order:
When multiple rules match a file:
Best practices for understanding permissions
file = syft_perm.open("data.csv")
explanation = file.explain_permissions("bob@example.com")
print(explanation)
file = syft_perm.open("research/")
file # Shows interactive permission viewer
The reason often includes the exact YAML file location, helping you find where to make changes.
If you see "Included via write permission", the user has write access somewhere that automatically grants read.