8000 [PM-19703] Fix admin count logic to exclude current organization by JimmyVo16 · Pull Request #5918 · bitwarden/server · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-19703] Fix admin count logic to exclude current organization #5918

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
Jun 13, 2025

Conversation

JimmyVo16
Copy link
Contributor
@JimmyVo16 JimmyVo16 commented Jun 4, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-19703

📔 Objective

This change fixes an edge case in the edit user flow where the admin count check incorrectly included the current organization. As a result, attempts to modify a user who is already an admin or owner of the current org were mistakenly blocked.

Code changes

  1. Check the current role and handle the logic differently if the user is an admin or owner.
  2. Add unit tests to cover edge cases.
  3. Update unit tests to account for UpdateUserAsync and its new parameter, existingUserType.

📸 Screenshots

Performed manual testing for sanity check.

Testing.the.user.edit.flow.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

< 8000 div class="pr-1 flex-auto min-width-0" > [PM-19703] Fix admin count logic to exclude current organization
@JimmyVo16 JimmyVo16 self-assigned this Jun 4, 2025
Copy link
Contributor
github-actions bot commented Jun 4, 2025

Logo
Checkmarx One – Scan Summary & Details6f05b90e-5f2c-41c5-ae0d-460c4173d083

Great job, no security vulnerabilities found in this Pull Request

Copy link
codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 47.62%. Comparing base (db77201) to head (b4eee9c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...OrganizationUsers/UpdateOrganizationUserCommand.cs 52.38% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5918      +/-   ##
==========================================
- Coverage   47.62%   47.62%   -0.01%     
==========================================
  Files        1665     1665              
  Lines       75101    75117      +16     
  Branches     6768     6772       +4     
==========================================
+ Hits        35768    35775       +7     
- Misses      37878    37884       +6     
- Partials     1455     1458       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JimmyVo16 JimmyVo16 marked this pull request as ready for review June 4, 2025 17:19
@JimmyVo16 JimmyVo16 requested a review from a team as a code owner June 4, 2025 17:19
@JimmyVo16 JimmyVo16 requested a review from r-tome June 4, 2025 17:19
Copy link

@JimmyVo16 JimmyVo16 merged commit 4a12120 into main Jun 13, 2025
39 checks passed
@JimmyVo16 JimmyVo16 deleted the ac/pm-19703/fix-admin-count-includes-current-org branch June 13, 2025 20:27
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
0