Frontend first draft
This commit is contained in:
13
frontend/pshared/lib/models/permissions/effect.dart
Normal file
13
frontend/pshared/lib/models/permissions/effect.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
enum Effect {
|
||||
allow,
|
||||
deny,
|
||||
}
|
||||
|
||||
extension EffectExtension on Effect {
|
||||
String toShortString() => toString().split('.').last;
|
||||
|
||||
static Effect fromString(String value) => Effect.values.firstWhere(
|
||||
(e) => e.toShortString() == value,
|
||||
orElse: () => throw ArgumentError('Invalid effect: $value'),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user