Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.transluce.org/llms.txt

Use this file to discover all available pages before exploring further.

Control who can access your collections. Sharing requires admin permission on the collection.

Check Permissions

from docent import Docent

client = Docent()

has_write = client.has_collection_permission("my-collection-id", "write")
print(f"Has write access: {has_write}")

Parameters

collection_id
str
required
ID of the collection.
permission
str
default:"write"
Permission level to check: "read", "write", or "admin".

Share with the Public

# Make publicly readable
client.share_collection_with_public("my-collection-id", permission="read")

# Remove public access
client.unshare_collection_with_public("my-collection-id")

Parameters

collection_id
str
required
ID of the collection.
permission
Literal['read', 'write']
default:"read"
Public permission level.

Share with a User

By Email

client.share_collection_with_email("my-collection-id", "[email protected]")

By User ID

# Grant read access
client.share_collection_with_user("my-collection-id", "user-456", permission="read")

# Grant write access
client.share_collection_with_user("my-collection-id", "user-456", permission="write")

# Remove access
client.unshare_collection_with_user("my-collection-id", "user-456")

Parameters

collection_id
str
required
ID of the collection.
user_id
str
required
ID of the user.
permission
Literal['read', 'write', 'admin']
default:"read"
Permission level.

Share with an Organization

client.share_collection_with_organization(
    "my-collection-id",
    "org-789",
    permission="read",
)

# Remove organization access
client.unshare_collection_with_organization("my-collection-id", "org-789")

Parameters

collection_id
str
required
ID of the collection.
organization_id
str
required
ID of the organization.
permission
Literal['read', 'write', 'admin']
default:"read"
Permission level.

Organizations

List Your Organizations

orgs = client.get_my_organizations()
for org in orgs:
    print(f"{org['id']}: {org['name']}")

List Organization Users

users = client.get_organization_users("org-789")
for user in users:
    print(f"{user['id']}: {user.get('email')}")

List Collection Collaborators

collaborators = client.get_collection_collaborators("my-collection-id")
for c in collaborators:
    print(f"{c['subject_type']}/{c['subject_id']}: {c['permission_level']}")