Function getAllAuthorizedFullPathsForRoute

Recursively retrieves all authorized full paths for a given route.

This function checks if the userId has access to the given route based on locationData. If access is allowed, it collects all available paths (including nested child routes).

  • Parameters

    • route: any

      The route object containing path and children.

    • userId: string

      The ID of the user requesting access.

    • locationData: any

      Additional location-based authorization data.

    • OptionalroutePaths: { item: any; path: string }[] = []

      Accumulated list of authorized paths.

    Returns { item: any; path: string }[]

    • List of authorized full paths and their corresponding route objects.