digdir / dialogporten

Dialogporten - common API and and metadata state store for digital dialogs
https://docs.altinn.studio/dialogporten
MIT License
1 stars 3 forks source link

When using admin-scope, dialog.Org should be set to service resource owner #1409

Open elsand opened 2 weeks ago

elsand commented 2 weeks ago

Description

The admin-scope short circuits the AuthorizeServiceResources check, such that the calling system can create dialogs for any service resource. This is meant for othter internal writing Altinn integrations, such as correspondence and the Altinn Storage.

The Org population is however always performed based on the authenticated user, which causes "Digitaliseringsdirektoratet" to be the sender for all correspondence.

Reproduction

  1. Authenticate as Digdir, using the scope digdir:dialogporten.serviceprovider.admin
  2. Create a dialog referring a service resource owned by SKE
  3. Authenticate as an enduser with access to that dialog
  4. Fetch the dialog

Expected behavior

The dialog should have the "Org" field set to "ske"

Actual behavior

The dialog has the "Org" field set to "digdir"

Additional information

If there is additional context that is relevant to include.