allows method

  1. @override
bool allows(
  1. dynamic operation
)
override

Checks if this permission allows the given operation.

Implementation

@override
bool allows(dynamic operation) {
  if (operation is! Map<String, dynamic>) return false;

  final opType = operation['type'];
  final opOperation = operation['operation'];

  if (opType != 'dangerous') return false;

  return _operation == 'any dangerous operation' || opOperation == _operation;
}