mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
[AC-2703] Fix copy in members and groups modals for custom users (#9408)
* Fix copy in members and groups modals for custom users * Fix nesting in member dialog template
This commit is contained in:
@@ -52,7 +52,7 @@
|
|||||||
<bit-tab label="{{ 'collections' | i18n }}">
|
<bit-tab label="{{ 'collections' | i18n }}">
|
||||||
<p>
|
<p>
|
||||||
{{ "editGroupCollectionsDesc" | i18n }}
|
{{ "editGroupCollectionsDesc" | i18n }}
|
||||||
<span *ngIf="!(canEditAnyCollection$ | async)">
|
<span *ngIf="!(canAssignAccessToAnyCollection$ | async)">
|
||||||
{{ "restrictedCollectionAssignmentDesc" | i18n }}
|
{{ "restrictedCollectionAssignmentDesc" | i18n }}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -196,12 +196,17 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
protected canEditAnyCollection$ = combineLatest([
|
protected canAssignAccessToAnyCollection$ = combineLatest([
|
||||||
this.organization$,
|
this.organization$,
|
||||||
this.flexibleCollectionsV1Enabled$,
|
this.flexibleCollectionsV1Enabled$,
|
||||||
|
this.allowAdminAccessToAllCollectionItems$,
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(([org, flexibleCollectionsV1Enabled]) =>
|
map(
|
||||||
org.canEditAnyCollection(flexibleCollectionsV1Enabled),
|
([org, flexibleCollectionsV1Enabled, allowAdminAccessToAllCollectionItems]) =>
|
||||||
|
org.canEditAnyCollection(flexibleCollectionsV1Enabled) ||
|
||||||
|
// Manage Groups custom permission cannot edit any collection but they can assign access from this dialog
|
||||||
|
// if permitted by collection management settings
|
||||||
|
(org.permissions.manageGroups && allowAdminAccessToAllCollectionItems),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -278,9 +278,17 @@
|
|||||||
<div class="tw-mb-6" *ngIf="restrictEditingSelf$ | async">
|
<div class="tw-mb-6" *ngIf="restrictEditingSelf$ | async">
|
||||||
{{ "cannotAddYourselfToCollections" | i18n }}
|
{{ "cannotAddYourselfToCollections" | i18n }}
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="organization.useGroups && !(restrictEditingSelf$ | async)" class="tw-mb-6">
|
<div
|
||||||
|
*ngIf="
|
||||||
|
!(restrictEditingSelf$ | async) &&
|
||||||
|
(organization.useGroups || !(canAssignAccessToAnyCollection$ | async))
|
||||||
|
"
|
||||||
|
class="tw-mb-6"
|
||||||
|
>
|
||||||
|
<span *ngIf="organization.useGroups">
|
||||||
{{ "userPermissionOverrideHelperDesc" | i18n }}
|
{{ "userPermissionOverrideHelperDesc" | i18n }}
|
||||||
<span *ngIf="!(canEditAnyCollection$ | async)">
|
</span>
|
||||||
|
<span *ngIf="!(canAssignAccessToAnyCollection$ | async)">
|
||||||
{{ "restrictedCollectionAssignmentDesc" | i18n }}
|
{{ "restrictedCollectionAssignmentDesc" | i18n }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
|
|
||||||
protected allowAdminAccessToAllCollectionItems$: Observable<boolean>;
|
protected allowAdminAccessToAllCollectionItems$: Observable<boolean>;
|
||||||
protected restrictEditingSelf$: Observable<boolean>;
|
protected restrictEditingSelf$: Observable<boolean>;
|
||||||
protected canEditAnyCollection$: Observable<boolean>;
|
protected canAssignAccessToAnyCollection$: Observable<boolean>;
|
||||||
|
|
||||||
protected permissionsGroup = this.formBuilder.group({
|
protected permissionsGroup = this.formBuilder.group({
|
||||||
manageAssignedCollectionsGroup: this.formBuilder.group<Record<string, boolean>>({
|
manageAssignedCollectionsGroup: this.formBuilder.group<Record<string, boolean>>({
|
||||||
@@ -222,12 +222,17 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
FeatureFlag.FlexibleCollectionsV1,
|
FeatureFlag.FlexibleCollectionsV1,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.canEditAnyCollection$ = combineLatest([
|
this.canAssignAccessToAnyCollection$ = combineLatest([
|
||||||
this.organization$,
|
this.organization$,
|
||||||
flexibleCollectionsV1Enabled$,
|
flexibleCollectionsV1Enabled$,
|
||||||
|
this.allowAdminAccessToAllCollectionItems$,
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(([org, flexibleCollectionsV1Enabled]) =>
|
map(
|
||||||
org.canEditAnyCollection(flexibleCollectionsV1Enabled),
|
([org, flexibleCollectionsV1Enabled, allowAdminAccessToAllCollectionItems]) =>
|
||||||
|
org.canEditAnyCollection(flexibleCollectionsV1Enabled) ||
|
||||||
|
// Manage Users custom permission cannot edit any collection but they can assign access from this dialog
|
||||||
|
// if permitted by collection management settings
|
||||||
|
(org.permissions.manageUsers && allowAdminAccessToAllCollectionItems),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user