rules:
  # Catalog, Analytics and Master Rights: distributor check allowed.
  - path: /distributor
    methods: [HEAD]
    profiles:
      LabelProfile: [catalog, marketing, analytics, administrator, accounting, manage rights]

  # Catalog, Marketing, analytic and accounting: identity check allowed.
  - path: /identity
    methods: [GET]
    profiles:
      LabelProfile: [catalog, marketing, analytics, administrator, accounting, manage rights]

  # Catalog: Is allowed to get subaccount details.
  # This will 404 if the label is not a d3/has no subaccounts.
  - path: /subaccounts
    methods: [GET]
    profiles:
      LabelProfile: [catalog, marketing, administrator, accounting]

  - path: /subaccount/<int>
    methods: [GET]
    profiles:
      LabelProfile: [catalog, marketing, analytics, administrator, accounting, manage rights]
      InsightsProfile: ['*']
      CollaboratorsProfile: [royalties]
      ContentProfile: [view_orchard_sound_recording]
      SettingsProfile: ['*']

  # This will 404 if the label <int> is not a d3/has no subaccounts.
  - path: /<int>/subaccounts
    methods: [GET]
    profiles:
      InsightsProfile: [analytics]
      CollaboratorsProfile: [royalties]
      MoneyhubProfile: [accounting]
      AbacusProfile: [administrator]

  - path: /vendor/<int>
    methods: [GET]
    profiles:
      LabelProfile: [catalog, marketing, analytics, administrator, accounting, manage rights]
      InsightsProfile: [analytics]
      CollaboratorsProfile: [royalties]
      ContentProfile: [review_digital_audio, view_orchard_sound_recording, manage_nr_repertoire, manage_nr_ownership, bulk_create_digital_audio]
      SettingsProfile: ['*']
      OrchAdminProfile: ['*']
      AbacusProfile: ['administrator']
      MoneyhubProfile: [administrator, accounting]
      DistributionProfile: [manage_nr_deliveries, deliver_physical_audio, manage_nr_ownership]

  - path: /vendors/closers/dataloader
    methods: [POST]
    profiles:
      OrchAdminProfile: ['*']
  
  - path: /vendor/<vendor_uuid>/closers
    methods: [PUT]
    profiles:
      OrchAdminProfile: ['*']

  - path: /vendor/<int>/features
    methods: [GET]
    profiles:
      SettingsProfile: ['*']
      CollaboratorsProfile: ['*']
      MoneyhubProfile: ['*']

  - path: /vendor/features/<int>
    methods: [GET]
    profiles:
      AbacusProfile: ['*']

  - path: /vendor/<int>/service-details
    methods: [GET]
    profiles:
      ContentProfile: [review_digital_audio]
      OrchAdminProfile: ['*']

  - path: /vendor/<int>/assigned-to
    methods: [GET]
    profiles:
      ContentProfile: [review_digital_audio]
      OrchAdminProfile: ['*']

  - path: /vendor/<int>/secondary-internal-contact
    methods: [GET]
    profiles:
      ContentProfile: [review_digital_audio]
      OrchAdminProfile: ['*']

  - path: /vendor/<int>/assigned-reviewer
    methods: [GET]
    profiles:
      ContentProfile: [review_digital_audio]
      OrchAdminProfile: ['*']

  - path: /v2/vendor/<vendor_id>
    methods: [ PATCH ]
    profiles:
      OrchAdminProfile: [ '*' ]

  - path: /vendor/<vendor_id>
    methods: [ PATCH ]
    profiles:
      OrchAdminProfile: [ '*' ]

  - path: /owners
    methods: [ GET ]
    profiles:
      OrchAdminProfile: [ '*' ]
      AbacusProfile: [ '*' ]
      Account360Profile: [ '*' ]

  - path: /vendors/dataloader
    methods: [ POST ]
    profiles:
      OrchAdminProfile: [ '*' ]
      AbacusProfile: [ '*' ]
      ArtistProfile: [ '*' ]
      AudienceProfile: [ '*' ]
      CollaboratorsProfile: [ '*' ]
      ContentProfile: [ '*' ]
      DistributionProfile: [ '*' ]
      DocumentsProfile: [ '*' ]
      InsightsProfile: [ '*' ]
      LabelProfile: [ '*' ]
      MoneyhubProfile: [ '*' ]
      PodcastProfile: [ '*' ]
      PublishingProfile: [ '*' ]
      SettingsProfile: [ '*' ]
      SongwhipProfile: [ '*' ]

  - path: /vendors/first_statement_period/dataloader
    methods: [POST]
    profiles:
      OrchAdminProfile: ['*']

  - path: /vendor/<vendor_uuid>/first_statement_period
    methods: [PATCH]
    profiles:
      OrchAdminProfile: ['*']

  - path: /vendor/<vendor_uuid>/relationship_notes
    methods: [PATCH]
    profiles:
      OrchAdminProfile: ['*']

  - path: /vendors/relationship_notes/dataloader
    methods: [POST]
    profiles:
      OrchAdminProfile: ['*']

  # Admin: Allow all.
  - path: <*>
    methods: ['*']
    profiles:
      LabelProfile: [administrator]
      OrchAdminProfile: ['*']
