Frontend first draft
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/permissions/description/policy.dart';
|
||||
import 'package:pshared/data/dto/permissions/description/role.dart';
|
||||
|
||||
part 'description.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PermissionsDescriptionDTO {
|
||||
final List<RoleDescriptionDTO> roles;
|
||||
final List<PolicyDescriptionDTO> policies;
|
||||
|
||||
const PermissionsDescriptionDTO({
|
||||
required this.roles,
|
||||
required this.policies,
|
||||
});
|
||||
|
||||
factory PermissionsDescriptionDTO.fromJson(Map<String, dynamic> json) => _$PermissionsDescriptionDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$PermissionsDescriptionDTOToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
import 'package:pshared/models/resources.dart';
|
||||
|
||||
part 'policy.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PolicyDescriptionDTO extends StorableDTO {
|
||||
final List<ResourceType>? resourceTypes;
|
||||
final String? organizationRef;
|
||||
|
||||
const PolicyDescriptionDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required this.resourceTypes,
|
||||
required this.organizationRef,
|
||||
});
|
||||
|
||||
factory PolicyDescriptionDTO.fromJson(Map<String, dynamic> json) => _$PolicyDescriptionDTOFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$PolicyDescriptionDTOToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
|
||||
part 'role.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class RoleDescriptionDTO extends StorableDTO {
|
||||
final String organizationRef;
|
||||
|
||||
const RoleDescriptionDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required this.organizationRef,
|
||||
});
|
||||
|
||||
factory RoleDescriptionDTO.fromJson(Map<String, dynamic> json) => _$RoleDescriptionDTOFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$RoleDescriptionDTOToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user