@squidcloud/backend
    Preparing search index...

    Function secureDatabase

    • Decorator that marks a function for securing a database. The decorator takes a type of action and an optional integration ID. If no integration ID is provided, the built_in_db integration is used.

      The function should return a boolean or a Promise of a boolean indicating whether the action is allowed. In addition, depending on the action, the function can take a context object as a parameter. The context object contains information about the action.

      To read more about securing a database, see the documentation.

      Type Parameters

      • T extends DatabaseActionType

      Parameters

      • type: T

        The type of action to secure.

      • OptionalintegrationId: string

        The ID of the integration to secure.

      Returns ActionMethodDecorator<SecureDatabaseAction<T>>