[IA-4524] user management improve csv export permission role projects#2696
Open
[IA-4524] user management improve csv export permission role projects#2696
Conversation
…ically for permissions, adding a prefetch for user's permissions
…n the user permissions
…ng the dynamic columns for permissions
…t-permission-role-projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem is this PR solving?
This PR is about changing how the columns: permissions, roles and projects are displayed in the CSV and XLSX export. The former way consisted on making a columns in which all the permissions were displayed, same for roles and projects. The new way consists on showing all the permissions, roles and projects related to the account each one in its column and display
0and1to show if the user has the permission/role/projects.Related JIRA tickets
https://bluesquare.atlassian.net/browse/IA-4524
Changes
iaso/api/profiles/profiles.py, I fetched all the permissions related to the account, created a logic to see which permission the user has to display 1 or 0 depending on the result, displayed the matrix of the permissionsiaso/tests/api/test_profiles.py, I changedtest_profile_list_export_as_csvandtest_profile_list_export_as_csvto include the permissions matrix and then I added a new test to see if the export include the complete permission matrix while ignoring the permissions inherited from the user roles.How to test
Because I only changed the view
list_export, the only test needed is:sudo docker compose exec iaso python manage.py test iaso.tests.api.test_profilesPrint screen / video
Notes
Things that the reviewers should know:
Doc
Tell us where the doc can be found (docs folder, wiki, in the code...).