Merge branch 'main' into auth/pm-7392/token-service-add-secure-storage-fallback

This commit is contained in:
Jared Snider 2024-05-13 18:38:51 -04:00 committed by GitHub
commit e473456f44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 26 additions and 12 deletions

View File

@ -83,9 +83,7 @@
{{ "access" | i18n }}
</button>
</ng-container>
<ng-container
*ngIf="flexibleCollectionsV1Enabled && !canEditCollection && canViewCollectionInfo"
>
<ng-container *ngIf="!canEditCollection && canViewCollectionInfo">
<button type="button" bitMenuItem (click)="edit(true)">
<i class="bwi bwi-fw bwi-pencil-square" aria-hidden="true"></i>
{{ "viewInfo" | i18n }}

View File

@ -168,7 +168,7 @@ export class VaultItemsComponent {
protected canViewCollectionInfo(collection: CollectionView) {
const organization = this.allOrganizations.find((o) => o.id === collection.organizationId);
return collection.canViewCollectionInfo(organization);
return collection.canViewCollectionInfo(organization, this.flexibleCollectionsV1Enabled);
}
protected toggleAll() {

View File

@ -88,7 +88,14 @@ export class CollectionAdminView extends CollectionView {
/**
* Returns true if the user can view collection info and access in a read-only state from the Admin Console
*/
override canViewCollectionInfo(org: Organization | undefined): boolean {
override canViewCollectionInfo(
org: Organization | undefined,
flexibleCollectionsV1Enabled: boolean,
): boolean {
if (!flexibleCollectionsV1Enabled) {
return false;
}
if (this.isUnassignedCollection) {
return false;
}

View File

@ -28,7 +28,11 @@
</bit-breadcrumbs>
<ng-container slot="title-suffix">
<ng-container *ngIf="collection != null && (canEditCollection || canDeleteCollection)">
<ng-container
*ngIf="
collection != null && (canEditCollection || canDeleteCollection || canViewCollectionInfo)
"
>
<button
bitIconButton="bwi-angle-down"
[bitMenuTriggerFor]="editCollectionMenu"
@ -55,9 +59,7 @@
{{ "access" | i18n }}
</button>
</ng-container>
<ng-container
*ngIf="flexibleCollectionsV1Enabled && !canEditCollection && canViewCollectionInfo"
>
<ng-container *ngIf="!canEditCollection && canViewCollectionInfo">
<button
type="button"
bitMenuItem

View File

@ -211,7 +211,10 @@ export class VaultHeaderComponent implements OnInit {
}
get canViewCollectionInfo(): boolean {
return this.collection.node.canViewCollectionInfo(this.organization);
return this.collection.node.canViewCollectionInfo(
this.organization,
this.flexibleCollectionsV1Enabled,
);
}
get canCreateCollection(): boolean {

View File

@ -387,9 +387,10 @@ export class PinService implements PinServiceAbstraction {
);
const encUserKey = await this.stateService.getEncryptedCryptoSymmetricKey({ userId: userId });
const userKey = await this.masterPasswordService.decryptUserKeyWithMasterKey(
masterKey,
new EncString(encUserKey),
encUserKey ? new EncString(encUserKey) : undefined,
);
const pinKeyEncryptedUserKey = await this.createPinKeyEncryptedUserKey(pin, userKey, userId);

View File

@ -92,7 +92,10 @@ export class CollectionView implements View, ITreeNodeObject {
/**
* Returns true if the user can view collection info and access in a read-only state from the individual vault
*/
canViewCollectionInfo(org: Organization | undefined): boolean {
canViewCollectionInfo(
org: Organization | undefined,
flexibleCollectionsV1Enabled: boolean,
): boolean {
return false;
}