add support for readonly flag on collections

This commit is contained in:
Kyle Spearrin 2018-06-11 14:32:35 -04:00
parent 4bd9a9fc11
commit 5db55496c2
4 changed files with 9 additions and 1 deletions

View File

@ -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;
} }
} }

View File

@ -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> {

View File

@ -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;
} }
} }

View File

@ -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;
} }
} }