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

[PM-11360] Remove export permission for providers #12062

Merged
merged 12 commits into from
Nov 21, 2024

Conversation

eliykat
Copy link
Member

@eliykat eliykat commented Nov 20, 2024

🎟️ Tracking

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

📔 Objective

Remove provider export permissions. Provider users will not have the ability to access an organization’s export tab or export a managed organization’s items.

  • split organization.canAccessImportExport into separate getters for import and export (providers can still import)
  • restrict provider access to export (behind a feature flag)

Server PR: bitwarden/server#5051

📸 Screenshots

⏰ 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

@eliykat eliykat requested review from a team as code owners November 20, 2024 04:01
@eliykat eliykat requested a review from r-tome November 20, 2024 04:01
@eliykat eliykat changed the title [PM-11360]Ac/pm 11360/remove vault export permission for providers [PM-11360] Remove export permission for providers Nov 20, 2024
Copy link
Member Author

@eliykat eliykat Nov 20, 2024

Choose a reason for hiding this comment

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

Tools Team: this is just updating the org.canAccessImportExport property reference, which has been split into org.canAccessImport and org.canAccessExport. Given that this is the import component, it now refers to org.canAccessImport.

Comment on lines -292 to 290
canAccessImport(this.i18nService),
map((orgs) => orgs.filter((org) => org.canAccessImport)),
map((orgs) => orgs.sort(Utils.getSortFunction(this.i18nService, "name"))),
Copy link
Member Author

@eliykat eliykat Nov 20, 2024

Choose a reason for hiding this comment

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

The canAccessImport helper function in organization.service.abstraction has also been removed because it was only used here and this is all it was doing.

);
}

canAccessExport(removeProviderExport: boolean) {
Copy link
Member Author

Choose a reason for hiding this comment

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

It's a bit awkward to make callers fetch their own feature flag value to pass in. I tried some other approaches, but introducing any observable or promise here makes pretty large waves through all its callers. This remains the simplest approach for now.

Copy link
Contributor

github-actions bot commented Nov 20, 2024

Logo
Checkmarx One – Scan Summary & Details87284dc1-1623-47fd-a13a-bd96053e76b7

Fixed Issues

Severity Issue Source File / Package
LOW Client_JQuery_Deprecated_Symbols /apps/cli/src/service-container/service-container.ts: 876

}

return (
this.isMember &&
Copy link
Member Author

@eliykat eliykat Nov 20, 2024

Choose a reason for hiding this comment

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

This is necessary because some of our model mapping is wrong. I've logged a bug here: https://bitwarden.atlassian.net/browse/PM-15078

@eliykat eliykat requested a review from a team as a code owner November 20, 2024 05:38
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 11.62791% with 38 lines in your changes missing coverage. Please review.

Project coverage is 33.45%. Comparing base (34e20b7) to head (079d9b9).
Report is 9 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...s/settings/organization-settings-routing.module.ts 0.00% 14 Missing ⚠️
...nizations/layouts/organization-layout.component.ts 40.00% 6 Missing ⚠️
...on/src/admin-console/models/domain/organization.ts 0.00% 6 Missing ⚠️
libs/importer/src/components/import.component.ts 0.00% 5 Missing ⚠️
...navigation-switcher/navigation-switcher.stories.ts 0.00% 3 Missing ⚠️
...youts/product-switcher/product-switcher.stories.ts 0.00% 3 Missing ⚠️
apps/cli/src/tools/import.command.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12062   +/-   ##
=======================================
  Coverage   33.44%   33.45%           
=======================================
  Files        2864     2864           
  Lines       89666    89667    +1     
  Branches    17067    17067           
=======================================
+ Hits        29988    29997    +9     
+ Misses      57317    57309    -8     
  Partials     2361     2361           

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


🚨 Try these New Features:

audreyality
audreyality previously approved these changes Nov 20, 2024
Copy link
Contributor

@audreyality audreyality left a comment

Choose a reason for hiding this comment

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

👍🏻 Tools changes LGTM!

r-tome
r-tome previously approved these changes Nov 20, 2024
vleague2
vleague2 previously approved these changes Nov 20, 2024
Copy link
Contributor

@vleague2 vleague2 left a comment

Choose a reason for hiding this comment

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

DS-owned file looks good!

@eliykat eliykat dismissed stale reviews from vleague2, r-tome, and audreyality via f0acba9 November 21, 2024 00:33
@eliykat
Copy link
Member Author

eliykat commented Nov 21, 2024

I had to fix some mocks used in Storybook. The remaining 1 story change is an unapproved change from main which I will chase up now, but is not caused by this PR.

@eliykat eliykat merged commit 9e9f977 into main Nov 21, 2024
71 checks passed
@eliykat eliykat deleted the ac/pm-11360/remove-vault-export-permission-for-providers branch November 21, 2024 21:58
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.

4 participants