From 507533646f2744f3afaa21a0d40a138f9ebf0aab Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 20 Nov 2022 17:24:10 +0530 Subject: [PATCH] Collection: Persist user role --- lib/models/collection.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/models/collection.dart b/lib/models/collection.dart index 48f63f681..59a85250a 100644 --- a/lib/models/collection.dart +++ b/lib/models/collection.dart @@ -206,19 +206,17 @@ class User { int? id; String email; String? name; + String role; User({ this.id, required this.email, this.name, + this.role, }); Map toMap() { - return { - 'id': id, - 'email': email, - 'name': name, - }; + return {'id': id, 'email': email, 'name': name, 'role': role}; } static fromMap(Map? map) { @@ -228,6 +226,7 @@ class User { id: map['id'], email: map['email'], name: map['name'], + role: map['role'] ?? 'VIEWER', ); }