You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-16 07:24:40 +02:00
feat(web): granular api access controls (#18179)
* feat: api access control * feat(web): granular api access controls * fix test * fix e2e test * fix: lint * pr feedback * merge main + new design * finalize styling --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
14
mobile/openapi/lib/model/api_key_update_dto.dart
generated
14
mobile/openapi/lib/model/api_key_update_dto.dart
generated
@ -14,25 +14,31 @@ class APIKeyUpdateDto {
|
||||
/// Returns a new [APIKeyUpdateDto] instance.
|
||||
APIKeyUpdateDto({
|
||||
required this.name,
|
||||
this.permissions = const [],
|
||||
});
|
||||
|
||||
String name;
|
||||
|
||||
List<Permission> permissions;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is APIKeyUpdateDto &&
|
||||
other.name == name;
|
||||
other.name == name &&
|
||||
_deepEquality.equals(other.permissions, permissions);
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(name.hashCode);
|
||||
(name.hashCode) +
|
||||
(permissions.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'APIKeyUpdateDto[name=$name]';
|
||||
String toString() => 'APIKeyUpdateDto[name=$name, permissions=$permissions]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'name'] = this.name;
|
||||
json[r'permissions'] = this.permissions;
|
||||
return json;
|
||||
}
|
||||
|
||||
@ -46,6 +52,7 @@ class APIKeyUpdateDto {
|
||||
|
||||
return APIKeyUpdateDto(
|
||||
name: mapValueOfType<String>(json, r'name')!,
|
||||
permissions: Permission.listFromJson(json[r'permissions']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@ -94,6 +101,7 @@ class APIKeyUpdateDto {
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'name',
|
||||
'permissions',
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user