Skip to content

Commit

Permalink
Add manage property to synced Collection data
Browse files Browse the repository at this point in the history
  • Loading branch information
eliykat committed Sep 27, 2023
1 parent b2e7b85 commit f7fa30b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libs/common/src/vault/models/data/collection.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ export class CollectionData {
name: string;
externalId: string;
readOnly: boolean;
manage: boolean;

constructor(response: CollectionDetailsResponse) {
this.id = response.id;
this.organizationId = response.organizationId;
this.name = response.name;
this.externalId = response.externalId;
this.readOnly = response.readOnly;
this.manage = response.manage;
}
}
4 changes: 3 additions & 1 deletion libs/common/src/vault/models/domain/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class Collection extends Domain {
externalId: string;
readOnly: boolean;
hidePasswords: boolean;
manage: boolean;

constructor(obj?: CollectionData) {
super();
Expand All @@ -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"]
);
}

Expand Down
2 changes: 2 additions & 0 deletions libs/common/src/vault/models/response/collection.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
2 changes: 2 additions & 0 deletions libs/common/src/vault/models/view/collection.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
}
}

0 comments on commit f7fa30b

Please sign in to comment.