Policy class

Implementers

Constructors

Policy()

Properties

hashCode int
The hash code for this object.
no setterinherited
model HashMap<String, HashMap<String, Assertion>>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPolicies(String sec, String ptype, List<List<String>> rules) bool
addPolicies adds policy rules to the model. sec the section, "p" or "g". ptype the policy type, "p", "p2", .. or "g", "g2", .. rules the policy rules.
addPolicy(String sec, String ptype, List<String> rule) bool
Adds a policy rule to the model.
Initializes the roles in RBAC.
clearPolicy() → void
Clears all current policy.
getFilteredPolicy(String sec, String ptype, int fieldIndex, List<String> fieldValues) List<List<String>>
Returns the filtered policy rules of section sec and policy type ptype.
getPolicy(String sec, String ptype) List<List<String>>
Returns all rules in a policy.
getValuesForFieldInPolicy(String sec, String ptype, int fieldIndex) List<String>
Returns all values for a field for all rules in a policy, duplicated values are removed.
hasPolicies(String sec, String ptype, List<List<String>> rules) bool
hasPolicy(String sec, String ptype, List<String> rule) bool
Returns whether a model has the specified policy rule.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printPolicy() → void
Prints the policy to log.
removeFilteredPolicy(String sec, String ptype, int fieldIndex, List<String> fieldValues) bool
Removes policy rules based on field filters from the model.
removeFilteredPolicyReturnsEffects(String sec, String ptype, int fieldIndex, List<String> fieldValues) List<List<String>>
Removes policy rules based on field filters from the model.
removePolicies(String sec, String ptype, List<List<String>> rules) bool
removePolicies removes rules from the current policy. sec the section, "p" or "g". ptype the policy type, "p", "p2", .. or "g", "g2", .. rules the policy rules. succeeds or not.
removePolicy(String sec, String ptype, List<String> rule) bool
Removes a policy rule from the model.
savePolicyToText() String
Saves the policy to the text and returns the text.
toString() String
A string representation of this object.
inherited
updatePolicy(String sec, String ptype, List<String> oldRule, List<String> newRule) bool
UpdatePolicy updates a policy rule from the model.

Operators

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