allows method

bool allows(
  1. Permission type, [
  2. String? resource
])

Check if this permission set allows a specific action

Implementation

bool allows(Permission type, [String? resource]) {
  return permissions.any((p) => p.matches(type, resource));
}