crossbar.master.node.user¶
Classes¶
User management API (domain-global). |
Module Contents¶
- class UserManager(session, db, schema)[source]¶
Bases:
objectUser management API (domain-global).
Prefix:
crossbarfabriccenter.user.- async create_organization(organization, details=None)[source]¶
Create and store a new organization.
- Parameters:
organization
details (
autobahn.wamp.types.CallDetails) – Call details
- async delete_organization(org_oid, cascade=False, details=None)[source]¶
Delete an organization.
- Parameters:
org_oid
cascade
details (
autobahn.wamp.types.CallDetails) – Call details
- 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:
org_oid (str) – OID of the organization to get
details (
autobahn.wamp.types.CallDetails) – Call details
- Returns:
The organization database object (marshaled instance)
- Return type:
- abstractmethod get_roles_on_organization_for_user(org_id, user_id, details=None)[source]¶
- Async:
Get roles for a user on an organization.
- Parameters:
org_id (str)
user_id (str)
details (
autobahn.wamp.types.CallDetails) – Call details
- Returns:
Roles a user currently has on the organization.
- Return type:
- get_user(user_id, details=None)[source]¶
Get a particular user by OID.
- Parameters:
user_id (str) – OID of the user object to retrieve.
details (
autobahn.wamp.types.CallDetails) – Call details
- get_user_by_email(email, details=None)[source]¶
- Parameters:
email – Email (name) of the user to retrieve.
details (
autobahn.wamp.types.CallDetails) – Call details
- get_user_by_pubkey(pubkey, details=None)[source]¶
Get a user by public key.
- Parameters:
pubkey (str) – Public key of the user to retrieve.
details (
autobahn.wamp.types.CallDetails) – Call details
- 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:
- abstractmethod list_organizations_by_user(user_id, details=None)[source]¶
- Async:
List organizations with roles assigned for a given user.
- Parameters:
user_id (str) – The user to list organizations for.
details (
autobahn.wamp.types.CallDetails) – Call details
- 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:
org_id (str) – The organization to list users for.
details (
autobahn.wamp.types.CallDetails) – Call details
- abstractmethod modify_organization(org_oid, org_delta, details=None)[source]¶
- Async:
Modify an existing organization.
- Parameters:
org_oid
org_delta
details (
autobahn.wamp.types.CallDetails) – Call details
- 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:
user_id (str) – The user object to modify.
user_delta (marshaled instance of
cfxdb.user.User) – The modification object with attributes present for values to be modified.details (
autobahn.wamp.types.CallDetails) – Call details
- 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