Skip to content

feat: authentication secured event types #23208

@linear

Description

@linear

Problem

Platform customer has requested a setting on event type that if set to true will require admin auth when booking that event type.

Solution

Add a new property on the EventType model that can be updated via api and then during booking check if credentials of a user with sufficient permissions are provided.

Implementation

  1. Add a new property bookingRequiresAuthentication for the EventType in schema.prisma .
  2. Allow toggling this property via create-event-type.input.ts and update-event-type.input.ts inputs and then the output is event-type.output.ts.
  3. Add optional auth to bookings.controller.ts and pass optional auth user to bookings.service.ts that calls newly added function checkBookingRequiresAuthenticationSetting . If bookingRequiresAuthentication is true then booking will be only allowed if auth is passed and the auth credential belongs to either:
    1. owner of the event type
    2. system admin
    3. host of the event type
    4. admin or owner of team to which event type belongs
    5. organization admin or owner of an organization to which event type owner belongs to
  4. Add tests in managed-user-bookings.e2e-spec.ts testing that if bookingRequiresAuthentication is true that it can be booked using owner of event type, org admin but not using credential of other managed user that is a simple org member and has no connection to the event type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiarea: API, enterprise API, access token, OAuthevent-typesarea: event types, event-typesplatformAnything related to our platform plan✨ featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions