copyWith method

AuthorizationData copyWith({
  1. String? userId,
  2. List<String>? roles,
  3. List<String>? permissions,
  4. Map<String, dynamic>? attributes,
  5. DateTime? expiresAt,
  6. String? resource,
  7. String? action,
})

Create a copy with updated values

Implementation

AuthorizationData copyWith({
  String? userId,
  List<String>? roles,
  List<String>? permissions,
  Map<String, dynamic>? attributes,
  DateTime? expiresAt,
  String? resource,
  String? action,
}) {
  return AuthorizationData(
    userId: userId ?? this.userId,
    roles: roles ?? this.roles,
    permissions: permissions ?? this.permissions,
    attributes: attributes ?? this.attributes,
    expiresAt: expiresAt ?? this.expiresAt,
    resource: resource ?? this.resource,
    action: action ?? this.action,
  );
}