DefaultFilteredAdapter class

DefaultFilteredAdapter is the _filtered file adapter for Casbin. It can load policy from file or save policy to file and supports loading of _filtered policies.

Implemented types

Constructors

DefaultFilteredAdapter(String filepath)

Properties

adapter Adapter
getter/setter pair
filepath String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPolicy(String sec, String ptype, List<String> rule) → void
addPolicy adds a policy rule to the storage.
override
filterLine(String line, Filter? filter) bool
match the line.
filterWords(List<String> line, List<String> filter) bool
match the words in the specific line.
isFiltered() bool
return true if have any filter roles.
override
loadFilteredPolicy(Model model, dynamic filter) → void
loadFilteredPolicy loads only policy rules that match the filter. model the model. filter the filter used to specify which type of policy should be loaded. throws CasbinAdapterException if the file path or the type of the filter is incorrect.
override
loadFilteredPolicyFile(Model model, Filter filter, void handler(Model, String)) → void
loadFilteredPolicyFile loads only policy rules that match the filter from file.
loadPolicy(Model model) → void
loadPolicy loads all policy rules from the storage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFilteredPolicy(String sec, String ptype, int fieldIndex, List<String> fieldValues) → void
removeFilteredPolicy removes policy rules that match the filter from the storage.
override
removePolicy(String sec, String ptype, List<String> rule) → void
removePolicy removes a policy rule from the storage.
override
savePolicy(Model model) → void
savePolicy saves all policy rules to the storage.
override
toString() String
A string representation of this object.
inherited

Operators

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