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

[AC-1747] deprecate access control indicator #6796

Merged
merged 11 commits into from
Dec 12, 2023

Conversation

willmartian
Copy link
Contributor

@willmartian willmartian commented Nov 3, 2023

Type of change

- [ ] Bug fix
- [x] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

This PR hides the ability to grant a user or group access to all collections, based on FeatureFlag.FlexibleCollections.

Code changes

  • apps/web/src/app/admin-console/organizations/core/services/group/group.service.ts: When creating a GroupView, set accessAll to false if the feature flag is enabled.
  • apps/web/src/app/admin-console/organizations/core/services/user-admin.service.ts: When creating a OrganizationUserAdminView, set accessAll to false if the feature flag is enabled.
  • apps/web/src/app/admin-console/organizations/core/services/group/responses/group.response.ts: Add deprecation comment to accessAll field.
  • apps/web/src/app/admin-console/organizations/core/views/group.view.ts: Add deprecation comment to accessAll field.
  • apps/web/src/app/admin-console/organizations/core/views/organization-user-admin-view.ts: Add deprecation comment to accessAll field.
  • libs/common/src/admin-console/abstractions/organization-user/responses/organization-user.response.ts: Add deprecation comment to accessAll field.
  • apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html: Hide checkbox if feature flag is true
  • apps/web/src/app/admin-console/organizations/manage/group-add-edit.component.html: Hide checkbox if feature flag is true

Screenshots

FeatureFlag.FlexibleCollections === true

Screen.Recording.2023-11-03.at.4.54.01.PM.mov

FeatureFlag.FlexibleCollections === false

Screen.Recording.2023-11-03.at.4.52.45.PM.mov

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
  • Ensure that all UI additions follow WCAG AA requirements

@willmartian willmartian marked this pull request as ready for review November 3, 2023 21:41
@willmartian willmartian requested a review from a team as a code owner November 3, 2023 21:41
@willmartian willmartian requested a review from eliykat November 3, 2023 21:41
@bitwarden-bot
Copy link

bitwarden-bot commented Nov 3, 2023

Logo
Checkmarx One – Scan Summary & Details4188b818-d559-443a-9c72-37871f8c62a3

No New Or Fixed Issues Found

Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

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

These changes generally look good to me, thanks @willmartian!

OrganizationUserView also has an AccessAll property which doesn't look like it's dealt with here. It's consumed in PeopleComponent: https://github.com/bitwarden/clients/blob/ac/AC-1747/deprecate-access-control-indicator/apps/web/src/app/admin-console/organizations/members/people.component.ts#L244-L254

Do you think there's any benefit to overriding the value in the static fromResponse methods, so that you cannot actually instantiate it without having to deal with the feature flag logic? I don't feel strongly about it because it looks like you've caught it in all places anyway. But it would be extra protection against someone instantiating the object without properly handling this.

@willmartian
Copy link
Contributor Author

willmartian commented Dec 7, 2023

OrganizationUserView also has an AccessAll property which doesn't look like it's dealt with here. It's consumed in PeopleComponent: https://github.com/bitwarden/clients/blob/ac/AC-1747/deprecate-access-control-indicator/apps/web/src/app/admin-console/organizations/members/people.component.ts#L244-L254

Good catch, fixed in 86bcc6a and 582a524.

Do you think there's any benefit to overriding the value in the static fromResponse methods, so that you cannot actually instantiate it without having to deal with the feature flag logic? I don't feel strongly about it because it looks like you've caught it in all places anyway. But it would be extra protection against someone instantiating the object without properly handling this.

Agreed, the extra protection would be nice, but:

  1. Not all view models have fromResponse methods (such as the OrganizationUserAdminView) and would need to be dealt with wherever they are instantiated via constructor.
  2. Even if a view models has a fromResponse method, there is nothing stopping a dev from just using the constructor instead.

So I think we would need to be equally careful whether or not a parameter is added to the fromResponse method... which says to me to not even add it in the first place.

@willmartian willmartian requested a review from eliykat December 7, 2023 02:26
@willmartian willmartian merged commit 79dbe05 into master Dec 12, 2023
60 checks passed
@willmartian willmartian deleted the ac/AC-1747/deprecate-access-control-indicator branch December 12, 2023 03:40
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