flutter_policy_engine library

Classes

AbacEvaluator
Evaluates access based on Attribute-Based Access Control rules.
AbacPolicy
A collection of AttributeRules that must all pass for access to be granted.
AccessDecision
The outcome of an access control evaluation.
AttributeRule
A single attribute-matching rule used in ABAC evaluation.
CompositeEvaluator
Combines multiple PolicyEvaluator instances with a configurable strategy.
ConsoleLogger
A ILogger implementation that outputs to the Dart developer console.
DomainFailure
Base sealed class for all domain-layer failures.
EngineNotInitializedFailure
The engine was used before any policies were loaded.
Err<T, E>
Failed result carrying error.
FlutterAssetLoader
An IAssetLoader that reads Flutter asset bundle files via rootBundle.
IAssetLoader
Contract for loading raw text assets by path.
ILogger
Contract for structured logging within the policy engine.
InMemoryPolicyRepository
An in-memory IPolicyRepository implementation.
InvalidPolicyFailure
The input was malformed (e.g., empty role name or invalid structure).
IPolicyRepository
Contract for reading and writing the Policy aggregate.
MissingAttributeFailure
A required ABAC attribute is absent from the subject or resource.
NoopLogger
A no-operation ILogger that discards all log messages.
Ok<T, E>
Successful result carrying value.
ParseFailure
JSON or asset parsing failed.
Policy
The aggregate containing all loaded RoleEntity objects.
PolicyBuilder
An access-aware builder that exposes the AccessDecision to its subtree.
PolicyEngine
The application facade for the policy engine.
PolicyEngineController
Mutable state controller for the policy engine.
PolicyEngineScope
Provides a PolicyEngineController to the widget subtree.
PolicyEvaluator
Contract for RBAC policy evaluation.
PolicyGate
A widget that shows child when access is granted, and fallback (or nothing) when access is denied.
PolicyNotFoundFailure
No role/policy was found for the given name.
RbacEvaluator
Evaluates access based on Role-Based Access Control rules.
Resource
Represents the target resource being accessed.
ResourceNotAllowedFailure
The role exists but the requested resource is not in its allowed list.
Result<T, E>
A discriminated union representing either a successful value or a failure.
RoleEntity
A domain entity that maps a named role to a set of allowed resources.
RoleName
A value object representing a validated, non-empty role identifier.
SharedPreferencesPolicyRepository
A persistent IPolicyRepository backed by SharedPreferences.
StorageFailure
A storage read/write operation failed.
Subject
The entity requesting access, carrying a set of key-value attributes.

Enums

CompositeStrategy
The decision strategy used when multiple evaluators disagree.
LogLevel
Log severity levels.

Extensions

ResultExtensions on Result<T, E>
Extension helpers on Result.

Typedefs

PolicyWidgetBuilder = Widget Function(BuildContext context, AccessDecision? decision)
Builder callback providing the access decision to the widget.