crossbar.master.node.user

Classes

UserManager

User management API (domain-global).

Module Contents

class UserManager(session, db, schema)[source]

Bases: object

User management API (domain-global).

Prefix: crossbarfabriccenter.user.

_PUBOPTS[source]
_prefix = None[source]
_session[source]
async create_organization(organization, details=None)[source]

Create and store a new organization.

Parameters:
db[source]
async delete_organization(org_oid, cascade=False, details=None)[source]

Delete an organization.

Parameters:
get_organization(org_oid, details=None)[source]

Return the organization definition by object OID. When no such object exists, an error will be returned.

Procedure:

crossbarfabriccenter.user.get_organization

Error:

crossbar.error.no_such_object

Here is a typical example, fetching all organization (accessible by the user):

async def test_get_all_orgs(session):
    oids = await session.call('crossbarfabriccenter.user.get_organizations')
    orgs = []
    if oids:
        for oid in oids:
            org = await session.call('crossbarfabriccenter.user.get_organization', oid)
            print('got organization {}: {}'.format(org.oid, org))
            orgs.append(org)
    return orgs
Parameters:
Returns:

The organization database object (marshaled instance)

Return type:

cfxdb.user.Organization

abstractmethod get_roles_on_organization_for_user(org_id, user_id, details=None)[source]
Async:

Get roles for a user on an organization.

Parameters:
Returns:

Roles a user currently has on the organization.

Return type:

list[str]

get_user(user_id, details=None)[source]

Get a particular user by OID.

Parameters:
get_user_by_email(email, details=None)[source]
Parameters:
get_user_by_pubkey(pubkey, details=None)[source]

Get a user by public key.

Parameters:
list_organizations(details=None)[source]

List all organizations accessible for the calling user. An organization is accessible for a user when at least one role was granted.

Procedure:

crossbarfabriccenter.user.list_organizations

Here is an example:

async def test_list_organizations(session):
    oids = await session.call('crossbarfabriccenter.organization.list_organizations')
    print('got organizations:', oids)
    return oids
Parameters:

details (autobahn.wamp.types.CallDetails) – Call details

Returns:

List of OIDs of management realms

Return type:

list[str]

abstractmethod list_organizations_by_user(user_id, details=None)[source]
Async:

List organizations with roles assigned for a given user.

Parameters:
list_users(details=None)[source]

List users.

Parameters:

details (autobahn.wamp.types.CallDetails) – Call details

abstractmethod list_users_by_organization(org_id, details=None)[source]
Async:

List users with at least one role assigned on an organization.

Parameters:
log[source]
abstractmethod modify_organization(org_oid, org_delta, details=None)[source]
Async:

Modify an existing organization.

Parameters:
abstractmethod modify_user(user_id, user_delta, details=None)[source]
Async:

Modify an existing user.

Procedure:

crossbarfabriccenter.user.modify_user

Event:

crossbarfabriccenter.user.on_user_modified

Error:

crossbar.error.no_such_object

Parameters:
Returns:

A change object which with attributes and values present the reflect the actual modification that was made.

Return type:

marshaled instance of cfxdb.user.User

register(session, prefix, options)[source]
schema[source]
abstractmethod set_roles_on_organization_for_user(org_id, user_id, roles, details=None)[source]
Async:

Set roles for a user on an organization.

Parameters: