mirror of
https://github.com/bitwarden/browser
synced 2026-01-06 02:23:44 +00:00
[AC-2086] Limit admin access - Collection Modal (#8335)
* feat: add view collection string, update button text, refs AC-2086 * feat: remove canEdit from Restricted Collection Access component, refs AC-2086 * feat: add view collection clicked flow, refs AC-2086 * fix: revert accidental svg icon changes, refs AC-2086 * feat: add input for access selector to hide multi select, refs AC-2086 * feat: apply readonly/disabled changes to access dialog, refs AC-2086 * fix: messages file conflict, refs AC-2086 * feat: apply disabled state to access selector, refs AC-2086 * fix: formatting, refs AC-2086 * fix: permission mode read only relocate, refs AC-2086 * fix: conform readonly casing, refs AC-2086
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
</select>
|
||||
</bit-form-field>
|
||||
|
||||
<bit-form-field class="tw-grow">
|
||||
<bit-form-field class="tw-grow" *ngIf="!disabled">
|
||||
<bit-label>{{ selectorLabelText }}</bit-label>
|
||||
<bit-multi-select
|
||||
class="tw-w-full"
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="item.readonly"
|
||||
*ngIf="item.readonly || disabled"
|
||||
class="tw-max-w-40 tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap tw-font-bold tw-text-muted"
|
||||
[title]="permissionLabelId(item.readonlyPermission) | i18n"
|
||||
>
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
<td bitCell class="tw-text-right">
|
||||
<button
|
||||
*ngIf="!item.readonly"
|
||||
*ngIf="!disabled && !item.readonly"
|
||||
type="button"
|
||||
bitIconButton="bwi-close"
|
||||
buttonType="muted"
|
||||
|
||||
@@ -121,6 +121,13 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
|
||||
protected permissionList: Permission[];
|
||||
protected initialPermission = CollectionPermission.View;
|
||||
|
||||
/**
|
||||
* When disabled, the access selector will make the assumption that a readonly state is desired.
|
||||
* The PermissionMode will be set to Readonly
|
||||
* The Multi-Select control will be hidden
|
||||
* The delete action on each row item will be hidden
|
||||
* The readonly permission label/property needs to configured on the access item views being passed into the component
|
||||
*/
|
||||
disabled: boolean;
|
||||
|
||||
/**
|
||||
@@ -225,6 +232,7 @@ export class AccessSelectorComponent implements ControlValueAccessor, OnInit, On
|
||||
|
||||
// Keep the internal FormGroup in sync
|
||||
if (this.disabled) {
|
||||
this.permissionMode = PermissionMode.Readonly;
|
||||
this.formGroup.disable();
|
||||
} else {
|
||||
this.formGroup.enable();
|
||||
|
||||
Reference in New Issue
Block a user