mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-17 01:31:25 +01:00
add support for readonly flag on collections
This commit is contained in:
parent
4bd9a9fc11
commit
5db55496c2
@ -4,10 +4,12 @@ export class CollectionData {
|
|||||||
id: string;
|
id: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
readOnly: boolean;
|
||||||
|
|
||||||
constructor(response: CollectionResponse) {
|
constructor(response: CollectionResponse) {
|
||||||
this.id = response.id;
|
this.id = response.id;
|
||||||
this.organizationId = response.organizationId;
|
this.organizationId = response.organizationId;
|
||||||
this.name = response.name;
|
this.name = response.name;
|
||||||
|
this.readOnly = response.readOnly;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ export class Collection extends Domain {
|
|||||||
id: string;
|
id: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
name: CipherString;
|
name: CipherString;
|
||||||
|
readOnly: boolean;
|
||||||
|
|
||||||
constructor(obj?: CollectionData, alreadyEncrypted: boolean = false) {
|
constructor(obj?: CollectionData, alreadyEncrypted: boolean = false) {
|
||||||
super();
|
super();
|
||||||
@ -20,7 +21,8 @@ export class Collection extends Domain {
|
|||||||
id: null,
|
id: null,
|
||||||
organizationId: null,
|
organizationId: null,
|
||||||
name: null,
|
name: null,
|
||||||
}, alreadyEncrypted, ['id', 'organizationId']);
|
readOnly: null,
|
||||||
|
}, alreadyEncrypted, ['id', 'organizationId', 'readOnly']);
|
||||||
}
|
}
|
||||||
|
|
||||||
decrypt(): Promise<CollectionView> {
|
decrypt(): Promise<CollectionView> {
|
||||||
|
@ -2,10 +2,12 @@ export class CollectionResponse {
|
|||||||
id: string;
|
id: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
readOnly: boolean;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
this.id = response.Id;
|
this.id = response.Id;
|
||||||
this.organizationId = response.OrganizationId;
|
this.organizationId = response.OrganizationId;
|
||||||
this.name = response.Name;
|
this.name = response.Name;
|
||||||
|
this.readOnly = response.ReadOnly || false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ export class CollectionView implements View {
|
|||||||
id: string;
|
id: string;
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
readOnly: boolean;
|
||||||
|
|
||||||
constructor(c?: Collection) {
|
constructor(c?: Collection) {
|
||||||
if (!c) {
|
if (!c) {
|
||||||
@ -14,5 +15,6 @@ export class CollectionView implements View {
|
|||||||
|
|
||||||
this.id = c.id;
|
this.id = c.id;
|
||||||
this.organizationId = c.organizationId;
|
this.organizationId = c.organizationId;
|
||||||
|
this.readOnly = c.readOnly;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user