mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-24 12:06:15 +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;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
readOnly: boolean;
|
||||
|
||||
constructor(response: CollectionResponse) {
|
||||
this.id = response.id;
|
||||
this.organizationId = response.organizationId;
|
||||
this.name = response.name;
|
||||
this.readOnly = response.readOnly;
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ export class Collection extends Domain {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
name: CipherString;
|
||||
readOnly: boolean;
|
||||
|
||||
constructor(obj?: CollectionData, alreadyEncrypted: boolean = false) {
|
||||
super();
|
||||
@ -20,7 +21,8 @@ export class Collection extends Domain {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
name: null,
|
||||
}, alreadyEncrypted, ['id', 'organizationId']);
|
||||
readOnly: null,
|
||||
}, alreadyEncrypted, ['id', 'organizationId', 'readOnly']);
|
||||
}
|
||||
|
||||
decrypt(): Promise<CollectionView> {
|
||||
|
@ -2,10 +2,12 @@ export class CollectionResponse {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
readOnly: boolean;
|
||||
|
||||
constructor(response: any) {
|
||||
this.id = response.Id;
|
||||
this.organizationId = response.OrganizationId;
|
||||
this.name = response.Name;
|
||||
this.readOnly = response.ReadOnly || false;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ export class CollectionView implements View {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
readOnly: boolean;
|
||||
|
||||
constructor(c?: Collection) {
|
||||
if (!c) {
|
||||
@ -14,5 +15,6 @@ export class CollectionView implements View {
|
||||
|
||||
this.id = c.id;
|
||||
this.organizationId = c.organizationId;
|
||||
this.readOnly = c.readOnly;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user