MultiAccessStrategy class final

MultiAccessStrategy — композиция из нескольких AccessStrategy.

Применяется, когда логика доступа разбита по нескольким источникам:

  • локальная стратегия (например, мок или кэш)
  • внешняя стратегия (например, из API, Firebase, Auth0)
  • временные заглушки

Проверка (hasPermission, hasRole, isFeatureEnabled) возвращает true, если хотя бы одна из стратегий даёт положительный ответ.

Используется по принципу "хоть кто-то разрешил — значит доступ есть".


Пример:

MultiAccessStrategy([
  LocalMockStrategy(),
  FirebasePermissionsStrategy(),
])
Implemented types
Annotations

Constructors

MultiAccessStrategy(List<AccessStrategy> strategies)
Создаёт объединённую стратегию доступа.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strategies → List<AccessStrategy>
Список стратегий, по которым выполняется проверка.
final

Methods

hasPermission(BuildContext context, String permission) → bool
Проверка пермишена (например, 'orders.edit')
override
hasRole(BuildContext context, String role) → bool
Проверка роли (если используется)
override
isFeatureEnabled(BuildContext context, String flag) → bool
Проверка feature-флага (например, 'new_ui')
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited