Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt

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

property Tables.owners : MutableSet[str]

The roles allowing to edit the data in tables and the schema of tables.

Example

>>> session_config = tt.SessionConfig(security=tt.SecurityConfig())
>>> session = tt.Session.start(session_config)
>>> table = session.create_table(
...     "Table", data_types={"ID": "String", "Value": "int"}, keys={"ID"}
... )
>>> table += ("foo", 42)
>>> session.tables.owners
{'ROLE_ADMIN'}
>>> authentication = tt.BasicAuthentication("username", "passwd")
>>> session.security.individual_roles[authentication.username] = {
...     "ROLE_USER"
... }
>>> session.security.basic_authentication.credentials[
...     authentication.username
... ] = authentication.password
>>> connected_session = tt.Session.connect(
...     session.url, authentication=authentication
... )
The user has none of the owners roles and is thus not allowed to edit the data in tables:
>>> connected_session.tables[table.name].drop()  
Traceback (most recent call last):
    ...
RuntimeError: This action is not available. ...
And not allowed to edit the schema of tables:
>>> del connected_session.tables[table.name]  
Traceback (most recent call last):
    ...
atoti._graphql.client.exceptions.GraphQLClientHttpError: HTTP status code: 400
Granting ownership to all users:
>>> session.tables.owners.add("ROLE_USER")
>>> sorted(session.tables.owners)
['ROLE_ADMIN', 'ROLE_USER']
See also: readers and restrictions.