Browse Source

Add manage property to synced Collection data

ac/ac-1662/can-delete-port-ffc
Thomas Rittson 2 years ago
parent
commit
65cd39589c
No known key found for this signature in database
GPG Key ID: CDDDA03861C35E27
  1. 2
      libs/common/src/vault/models/data/collection.data.ts
  2. 4
      libs/common/src/vault/models/domain/collection.ts
  3. 2
      libs/common/src/vault/models/response/collection.response.ts
  4. 2
      libs/common/src/vault/models/view/collection.view.ts

2
libs/common/src/vault/models/data/collection.data.ts

@ -6,6 +6,7 @@ export class CollectionData { @@ -6,6 +6,7 @@ export class CollectionData {
name: string;
externalId: string;
readOnly: boolean;
manage: boolean;
constructor(response: CollectionDetailsResponse) {
this.id = response.id;
@ -13,5 +14,6 @@ export class CollectionData { @@ -13,5 +14,6 @@ export class CollectionData {
this.name = response.name;
this.externalId = response.externalId;
this.readOnly = response.readOnly;
this.manage = response.manage;
}
}

4
libs/common/src/vault/models/domain/collection.ts

@ -10,6 +10,7 @@ export class Collection extends Domain { @@ -10,6 +10,7 @@ export class Collection extends Domain {
externalId: string;
readOnly: boolean;
hidePasswords: boolean;
manage: boolean;
constructor(obj?: CollectionData) {
super();
@ -27,8 +28,9 @@ export class Collection extends Domain { @@ -27,8 +28,9 @@ export class Collection extends Domain {
externalId: null,
readOnly: null,
hidePasswords: null,
manage: null,
},
["id", "organizationId", "externalId", "readOnly", "hidePasswords"]
["id", "organizationId", "externalId", "readOnly", "hidePasswords", "manage"]
);
}

2
libs/common/src/vault/models/response/collection.response.ts

@ -18,10 +18,12 @@ export class CollectionResponse extends BaseResponse { @@ -18,10 +18,12 @@ export class CollectionResponse extends BaseResponse {
export class CollectionDetailsResponse extends CollectionResponse {
readOnly: boolean;
manage: boolean;
constructor(response: any) {
super(response);
this.readOnly = this.getResponseProperty("ReadOnly") || false;
this.manage = this.getResponseProperty("Manage") || false;
}
}

2
libs/common/src/vault/models/view/collection.view.ts

@ -12,6 +12,7 @@ export class CollectionView implements View, ITreeNodeObject { @@ -12,6 +12,7 @@ export class CollectionView implements View, ITreeNodeObject {
externalId: string = null;
readOnly: boolean = null;
hidePasswords: boolean = null;
manage: boolean = null;
constructor(c?: Collection | CollectionAccessDetailsResponse) {
if (!c) {
@ -24,6 +25,7 @@ export class CollectionView implements View, ITreeNodeObject { @@ -24,6 +25,7 @@ export class CollectionView implements View, ITreeNodeObject {
if (c instanceof Collection) {
this.readOnly = c.readOnly;
this.hidePasswords = c.hidePasswords;
this.manage = c.manage;
}
}
}

Loading…
Cancel
Save