EffectiveAccess.fromJson constructor
EffectiveAccess.fromJson(
- Map<String, dynamic> json
)
Implementation
factory EffectiveAccess.fromJson(Map<String, dynamic> json) {
return EffectiveAccess(
resource: AccessResource.fromJson((json['resource'] as Map).cast<String, dynamic>()),
subject: AccessSubject.fromJson((json['subject'] as Map).cast<String, dynamic>()),
effectiveRoles: (json['effective_roles'] as List? ?? const []).whereType<String>().toList(),
capabilities: (json['capabilities'] as Map? ?? const {}).map((key, value) => MapEntry(key.toString(), value == true)),
);
}