access_control.models module

class access_control.models.Domain(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
description
id
name
parent_id
updated_at
class access_control.models.DomainRole(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
domain_id
grant_implicitly
role_id
updated_at
class access_control.models.GUID(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

Platform-independent GUID type.

Uses PostgreSQL’s UUID type, otherwise uses CHAR(32), storing as stringified hex values.

impl

alias of sqlalchemy.dialects.postgresql.base.UUID

load_dialect_impl(dialect)[source]

Return a TypeEngine object corresponding to a dialect.

This is an end-user override hook that can be used to provide differing types depending on the given dialect. It is used by the TypeDecorator implementation of type_engine() to help determine what type should ultimately be returned for a given TypeDecorator.

By default returns self.impl.

process_bind_param(value, dialect)[source]

Receive a bound parameter value to be converted.

Subclasses override this method to return the value that should be passed along to the underlying TypeEngine object, and from there to the DBAPI execute() method.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

This operation should be designed with the reverse operation in mind, which would be the process_result_value method of this class.

Parameters:
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.
  • dialect – the Dialect in use.
process_result_value(value, dialect)[source]

Receive a result-row column value to be converted.

Subclasses should implement this method to operate on data fetched from the database.

Subclasses override this method to return the value that should be passed back to the application, given a value that is already processed by the underlying TypeEngine object, originally from the DBAPI cursor method fetchone() or similar.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters:
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.
  • dialect – the Dialect in use.

This operation should be designed to be reversible by the “process_bind_param” method of this class.

class access_control.models.Invitation(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
email
expires_at
first_name
id
invitor_id
last_name
organisation_id
updated_at
class access_control.models.InvitationDomainRole(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
domain_id
invitation_id
role_id
updated_at
class access_control.models.InvitationSiteRole(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
invitation_id
role_id
site_id
updated_at
class access_control.models.Permission(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
description
id
name
updated_at
class access_control.models.Resource(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
description
id
updated_at
urn
class access_control.models.Role(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
description
id
label
requires_2fa
updated_at
class access_control.models.RoleResourcePermission(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
permission_id
resource_id
role_id
updated_at
class access_control.models.Site(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

client_id
created_at
description
domain_id
id
is_active
name
updated_at
class access_control.models.SiteRole(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
grant_implicitly
role_id
site_id
updated_at
class access_control.models.UserDomainRole(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
domain_id
role_id
updated_at
user_id
class access_control.models.UserSiteRole(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

created_at
role_id
site_id
updated_at
user_id
access_control.models.pg_utcnow(element, compiler, **kw)[source]
class access_control.models.utcnow(*clauses, **kwargs)[source]

Bases: sqlalchemy.sql.functions.FunctionElement

type = DateTime()