Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle both Set and array for currentUser.authorities when checking interpretations access [DHIS2-15964] #1586

Closed
wants to merge 6 commits into from

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Oct 5, 2023

Fixes https://dhis2.atlassian.net/browse/DHIS2-15964

In the olden days when we used d2.currentUser, authorities was a Set.
With the migration to the app-runtime, requesting currentUser or /me with the dataEngine, the authorities will be an array.

Choosing here to handle both instead of requiring array (and thus a major upgrade) since we have no documentation or strict types on our functions/components.

So apps that get the currentUser from d2 (like DV) and apps that get currentUser from dataEngine(like LL) will both work.

Maybe support for Set can be removed in a future major release.

Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@martinkrulltott martinkrulltott removed their request for review October 6, 2023 07:23
Copy link
Contributor

@HendrikThePendric HendrikThePendric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve now after pushing some changes. But I guess another team member should also approve (and merge).

@jenniferarnesen
Copy link
Collaborator Author

Changes by @HendrikThePendric LGTM. The function should throw an error if the needed arguments are not provided by the app.

@jenniferarnesen jenniferarnesen changed the title fix: handle both Set and array for currentUser.authorities when checking interpretations access fix: handle both Set and array for currentUser.authorities when checking interpretations access [DHIS2-15964] Oct 16, 2023
@martinkrulltott
Copy link
Contributor

Superseded by the combo PR #1588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants