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.
The roles allowing to read data from 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.readers
{'ROLE_USER'}
>>> 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 one of the readers roles and can thus read data from the table:
>>> connected_session.tables[table.name].query()
ID Value
0 foo 42
Changing the readers roles to revoke access:
>>> session.tables.readers.clear()
>>> try:
... connected_session.tables[table.name].query()
... except Exception as error:
... error.response.status_code
400