Skip to content

CDD-3481: Export Users to CSV - #3310

Open
itsthatianguy wants to merge 10 commits into
mainfrom
feature/cdd-3481-export-users-csv
Open

itsthatianguy wants to merge 10 commits into
mainfrom
feature/cdd-3481-export-users-csv

Conversation

@itsthatianguy

Copy link
Copy Markdown
Contributor

Description

This PR includes the following:

  • Export button added to ... on Users page
  • Exports Users and their assigned Permissions to a CSV file
  • Row only contains user id if they have no permissions
  • Otherwise one row per assigned permission
  • Filename timestamped
  • Audit log created when exported

Fixes #CDD-3481


Type of change

Please select the options that are relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Tech debt item (this is focused solely on addressing any relevant technical debt)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests at the right levels to prove my change is effective
  • I have added screenshots or screen grabs where appropriate
  • I have added docstrings in the correct style (google)

@itsthatianguy
itsthatianguy requested a review from a team as a code owner August 18, 2026 08:14
)


class TestUserCsvExporter(TestCase):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Potentially add a test for no users to test the CSV headers generation? Or is this suitably covered by checking

self.assertEqual(
            rows[0], "User ID,Permission Set,Gives Global Access,Permissions\r\n"
        )

every time?

permission_set = PermissionSet()
permission_set.theme = "-1"
permission_set.geography_type = "1"
assert permission_set.global_access == False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a question - where does the combination of theme and geography_type come from? To determine global access or not

@MeganB-2

Copy link
Copy Markdown
Collaborator

The ticket has the following AC's that I don't think are covered here?

  1. e2e tests for presence and absence of Export functionality (found on page in ellipses)
  2. Provide documentation outlining CSV columns/data as KOP

Comment thread cms/auth_content/views.py Outdated
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

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