RestrictedEntitlementMode

class q2_sdk.hq.db.restricted_entitlement_mode.RestrictedEntitlementModeRow(element, row_class=None, rename_fields=None)[source]

Bases: TableRow

ProfileId: int
ProfileName: str
class q2_sdk.hq.db.restricted_entitlement_mode.RestrictedEntitlementMode(logger, hq_credentials=None, ret_table_obj=None)[source]

Bases: DbObject

DbObject for managing Restricted Entitlement Mode (REM) profile configuration.

REM is a security feature that restricts customer access based on configurable profiles. Each profile defines which groups can use it, which transactions are allowed, and which audit actions apply.

Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.

Parameters:
  • logger – Reference to calling request’s logger (self.logger in your extension)

  • hq_credentials (Optional[HqCredentials]) – HQ Connectivity Information (Defaults to settings file)

  • ret_table_obj (Optional[bool]) – Flag to return list of LXML elements if False or TableRow objects from DB calls if True (Defaults to settings file)

NAME = 'RestrictedEntitlementMode'
REPRESENTATION_ROW_CLASS

alias of RestrictedEntitlementModeRow

add_arguments(parser)[source]

Hook for subclassed DbObjects to add custom arguments.

async get_profiles(group_id=None, serialize_for_cli=False)[source]

Get REM profiles, optionally filtered by GroupID.

Parameters:
  • group_id (Optional[int]) – Optional GroupID to filter profiles by

  • serialize_for_cli (bool) – Serialize the response for CLI output

Return type:

list[dict]

Returns:

List of profile dictionaries with ProfileId and ProfileName

async get_profile_groups(profile_id, serialize_for_cli=False)[source]

Get group mappings for a REM profile.

Parameters:
  • profile_id (int) – Profile ID to get groups for

  • serialize_for_cli (bool) – Serialize the response for CLI output

Return type:

list[dict]

Returns:

List of group dictionaries with GroupID, GroupName, ProfileId, and ProfileName

async get_profile_transactions(profile_id, serialize_for_cli=False)[source]

Get transaction configuration for a REM profile.

Parameters:
  • profile_id (int) – Profile ID to get transactions for

  • serialize_for_cli (bool) – Serialize the response for CLI output

Return type:

list[dict]

Returns:

List of transaction configuration dictionaries with all transaction fields, TransactionTypeName, TransactionTypeDescription, and ProfileName

async get_profile_audit_actions(profile_id, serialize_for_cli=False)[source]

Get audit action configuration for a REM profile.

Parameters:
  • profile_id (int) – Profile ID to get audit actions for

  • serialize_for_cli (bool) – Serialize the response for CLI output

Return type:

list[dict]

Returns:

List of audit action configuration dictionaries with ActionID, ActionName, ActionDescription, Allow, and ProfileName