From zero to managing permissions like a pro.
pip install syft-perm
Open any file and grant access to a colleague:
import syft_perm
# Open a file
file = syft_perm.open("research_data.csv")
# Grant read access to a colleague
file.grant_read_access("colleague@university.edu")
# That's it! They can now read the file.
See who can access your files:
# Check if someone has access
if file.has_read_access("reviewer@journal.org"):
print("Reviewer can read the file")
# Explain why someone has/doesn't have access
explanation = file.explain_permissions("reviewer@journal.org")
print(explanation)
Set permissions on folders - all files inside automatically inherit:
# Open a project folder
project = syft_perm.open("ml_project/")
# Grant different levels of access
project.grant_read_access("intern@company.com") # Can only read
project.grant_write_access("engineer@company.com") # Can read & write
project.grant_admin_access("lead@company.com") # Full control
# All files in the folder now have these permissions!
Here's how a research team might use SyftPerm:
# Set up a clinical trial project
trial = syft_perm.open("clinical_trial_2024/")
# External reviewers can only read
trial.grant_read_access("ethics@hospital.org")
trial.grant_read_access("reviewer@fda.gov")
# Research assistants can add data
trial.grant_write_access("assistant1@lab.edu")
trial.grant_write_access("assistant2@lab.edu")
# PI has full control
trial.grant_admin_access("pi@university.edu")
# Make summary public (but not raw data!)
summary = syft_perm.open("clinical_trial_2024/summary.pdf")
summary.grant_read_access("*") # Anyone can read the summary