class User { User({required this.id, required this.name, required this.email, required this.role}); final int id; final String name; final String email; final String role; // "owner" | "viewer" bool get isOwner => role == 'owner'; factory User.fromJson(Map json) => User( id: json['id'] as int, name: json['name'] as String, email: json['email'] as String, role: json['role'] as String, ); }