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-13128] Breadcrumb Policies #5438

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

[PM-13128] Breadcrumb Policies #5438

wants to merge 5 commits into from

Conversation

jonashendrickx
Copy link
Member

@jonashendrickx jonashendrickx commented Feb 24, 2025

🎟️ Tracking

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

📔 Objective

  • Add a new permission UseViewPolicies to allow reading or opening the Policies page.

📸 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

Copy link
Contributor

github-actions bot commented Feb 24, 2025

Logo
Checkmarx One – Scan Summary & Details2dabf20d-76be-4175-a6ab-b8b1246f6ba2

Fixed Issues (4)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 164
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 104
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/GroupsController.cs: 133
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 94

@@ -69,6 +69,7 @@ public OrganizationEditModel(
Seats = org.Seats;
MaxAutoscaleSeats = org.MaxAutoscaleSeats;
MaxCollections = org.MaxCollections;
UseViewPolicies = org.UseViewPolicies;
Copy link
Contributor

@cturnbull-bitwarden cturnbull-bitwarden Feb 25, 2025

Choose a reason for hiding this comment

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

There might be a misunderstanding with this PR and the Jira story. All the necessary changes should be achievable on the client side alone. We're just looking to update the display logic to include Teams organizations when viewing policies. The policies feature toggle also exists on the organization table under UsePolicies, though I don't expect you'll need it, unless there's a requirement to show the policies breadcrumbing for orgs that don't have it enabled

Copy link
Member Author

Choose a reason for hiding this comment

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

Based on https://bitwarden.atlassian.net/browse/PM-13128 I would have to enable UseViewPolicies for both Enterprise and Teams plans. Allowing us to view the Policies page. Then the breadcrumbing would be done checking directly for the teams plan to show the Enterprise upgrade badge.

Then the tab would be conditionally shown below to navigate to the Policies page. Which might be cleaner than having plan specific code leak all over the place. If we choose to change the naming of plans or introduce new plans, it would be easier to maintain our code base.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Roger that. I can see how it would be nice to add additional data to the organization table to split the view and edit permissions. If we do this, then we'll also need to write a script to update every Teams organization to enable this new column. That being the case because, for this to achieve the goal in the ticket of

GIVEN:

the user is the owner of a Teams org

the user is viewing the admin console for this org

THEN:

show “policies” in the left hand navigation

we'd need this value to be enabled for every teams org.

That said, we can make some assumptions about this authorization/role-based behavior given our criteria that allow us to not make any changes to this repository at all, and instead limit the changes to the clients repo.

If the organization's UsePolicies feature flag is not enabled, but the organization's productTierType is Teams, or TeamsStarter, which correspond to 2 and 4 respectively here, then we can conditionally display the nav menu item, and allow the user to navigate to the page.

Once the user is on the page, then we can implement the other requirements using similar logic, in addition to any change to make the fields read-only.

GIVEN:

the user is viewing the policies page OR

the user is viewing a policy modal

THEN: 

there is an upgrade badge next to the header
WHEN: 

the user selects the upgrade badge

THEN:

close the policy modal if open

open the current-plan-Teams upgrade modal

@jonashendrickx jonashendrickx changed the title [PM-13128] WIP [PM-13128] Breadcrumb Policies Feb 25, 2025
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.

2 participants