BOB Docs
APIApplicationUser

Invitation Service

It enforces business rules such as organizational boundaries and validates user actions for consistency and security.

Key Responsibilities

  1. Invitation Management:
  • Handles the creation, acceptance, deletion, and retrieval of invitations.
  1. Organizational Boundaries:
  • Ensures invitations are tied to the correct organizations and validates access permissions.
  1. Email Validation:
  • Verifies email addresses for invitation-related actions.

Key Methods

  1. invite_user(custom_user_id, organization_id, email):
  • Creates a new invitation if none exists for the given email within the organization.
  • Returns the created invitation object.
  1. accept_invitation(email, invitation_id):
  • Validates and accepts an invitation.
  • Assigns the user to the associated organization upon acceptance.
  1. delete_invitation(custom_user_id, organization_id, invitation_id):
  • Deletes an invitation if the user belongs to the same organization.
  1. delete_organization_invitations(organization_id):
  • Deletes all invitations associated with a specific organization.
  1. get_organization_invitations(organization_id):
  • Retrieves all invitations for a specific organization.
  • Includes related data about the invitation's owner.

Purpose

The InvitationService centralizes and standardizes invitation-related logic. This ensures data integrity and streamlines operations for managing invitations within organizations. By encapsulating the rules and processes, the service promotes consistency, reduces redundancy, and enhances the overall security of invitation handling.

On this page