mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
[PM-20167] Refactor: Remove SeparateCustomRolePermissions feature flag and flagged logic (#15628)
This commit is contained in:
@@ -134,17 +134,11 @@
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
bitCheckbox
|
bitCheckbox
|
||||||
formControlName="manageUsers"
|
formControlName="manageUsers"
|
||||||
(change)="handleDependentPermissions()"
|
|
||||||
/>
|
/>
|
||||||
<bit-label>{{ "manageUsers" | i18n }}</bit-label>
|
<bit-label>{{ "manageUsers" | i18n }}</bit-label>
|
||||||
</bit-form-control>
|
</bit-form-control>
|
||||||
<bit-form-control>
|
<bit-form-control>
|
||||||
<input
|
<input type="checkbox" bitCheckbox formControlName="manageResetPassword" />
|
||||||
type="checkbox"
|
|
||||||
bitCheckbox
|
|
||||||
formControlName="manageResetPassword"
|
|
||||||
(change)="handleDependentPermissions()"
|
|
||||||
/>
|
|
||||||
<bit-label>{{ "manageAccountRecovery" | i18n }}</bit-label>
|
<bit-label>{{ "manageAccountRecovery" | i18n }}</bit-label>
|
||||||
</bit-form-control>
|
</bit-form-control>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import { PermissionsApi } from "@bitwarden/common/admin-console/models/api/permi
|
|||||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
import { ProductTierType } from "@bitwarden/common/billing/enums";
|
||||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
|
||||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import {
|
import {
|
||||||
@@ -453,28 +452,6 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
return Object.assign(p, partialPermissions);
|
return Object.assign(p, partialPermissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleDependentPermissions() {
|
|
||||||
const separateCustomRolePermissions = await this.configService.getFeatureFlag(
|
|
||||||
FeatureFlag.SeparateCustomRolePermissions,
|
|
||||||
);
|
|
||||||
if (separateCustomRolePermissions) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Manage Password Reset (Account Recovery) must have Manage Users enabled
|
|
||||||
if (
|
|
||||||
this.permissionsGroup.value.manageResetPassword &&
|
|
||||||
!this.permissionsGroup.value.manageUsers
|
|
||||||
) {
|
|
||||||
this.permissionsGroup.value.manageUsers = true;
|
|
||||||
(document.getElementById("manageUsers") as HTMLInputElement).checked = true;
|
|
||||||
this.toastService.showToast({
|
|
||||||
variant: "info",
|
|
||||||
title: null,
|
|
||||||
message: this.i18nService.t("accountRecoveryManageUsers"),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
submit = async () => {
|
submit = async () => {
|
||||||
this.formGroup.markAllAsTouched();
|
this.formGroup.markAllAsTouched();
|
||||||
|
|
||||||
|
|||||||
@@ -244,18 +244,8 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
|
|||||||
)
|
)
|
||||||
.subscribe();
|
.subscribe();
|
||||||
|
|
||||||
// Setup feature flag-dependent observables
|
this.showUserManagementControls$ = organization$.pipe(
|
||||||
const separateCustomRolePermissionsEnabled$ = this.configService.getFeatureFlag$(
|
map((organization) => organization.canManageUsers),
|
||||||
FeatureFlag.SeparateCustomRolePermissions,
|
|
||||||
);
|
|
||||||
this.showUserManagementControls$ = combineLatest([
|
|
||||||
separateCustomRolePermissionsEnabled$,
|
|
||||||
organization$,
|
|
||||||
]).pipe(
|
|
||||||
map(
|
|
||||||
([separateCustomRolePermissionsEnabled, organization]) =>
|
|
||||||
!separateCustomRolePermissionsEnabled || organization.canManageUsers,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { ServerConfig } from "../platform/abstractions/config/server-config";
|
|||||||
// eslint-disable-next-line @bitwarden/platform/no-enums
|
// eslint-disable-next-line @bitwarden/platform/no-enums
|
||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
/* Admin Console Team */
|
/* Admin Console Team */
|
||||||
SeparateCustomRolePermissions = "pm-19917-separate-custom-role-permissions",
|
|
||||||
CreateDefaultLocation = "pm-19467-create-default-location",
|
CreateDefaultLocation = "pm-19467-create-default-location",
|
||||||
|
|
||||||
/* Auth */
|
/* Auth */
|
||||||
@@ -78,7 +77,6 @@ const FALSE = false as boolean;
|
|||||||
*/
|
*/
|
||||||
export const DefaultFeatureFlagValue = {
|
export const DefaultFeatureFlagValue = {
|
||||||
/* Admin Console Team */
|
/* Admin Console Team */
|
||||||
[FeatureFlag.SeparateCustomRolePermissions]: FALSE,
|
|
||||||
[FeatureFlag.CreateDefaultLocation]: FALSE,
|
[FeatureFlag.CreateDefaultLocation]: FALSE,
|
||||||
|
|
||||||
/* Autofill */
|
/* Autofill */
|
||||||
|
|||||||
Reference in New Issue
Block a user