Skip to content

Return both permission level and label from user permissions endpoint #68

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

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

jjnesbitt
Copy link
Member

After seeing our use of #67 in multinet-app/multinet-client#192, I realized it's cumbersome to not return the integer permission level itself from the the API, as we'll just need to reconstruct it on the client anyway. This PR amends that to return both the level itself and the associated label, returning null for both if they don't exist.

I think this will make the use of it much easier on the client, in particular removing the need for code like this. @naglepuff lmk what you think.

Change the function of `get_user_permission_label`, to return a tuple of
the permission level and label. This also renames the function to
`get_user_permission_tuple`.
@jjnesbitt jjnesbitt requested a review from naglepuff August 21, 2021 18:00
Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

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

I had one question for you about a change, but other than that I think this is a good idea and will make working with permissions much simpler for our client code.

Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm fine with all of these changes.

@jjnesbitt jjnesbitt merged commit 11fc729 into master Aug 23, 2021
@jjnesbitt jjnesbitt deleted the user-permission-with-level branch August 23, 2021 14:52
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