Model class
Model represents the whole access control model.
Constructors
- Model()
- Model.fromFile(String path)
- creates a model from a .CONF file.
- Model.fromString(String text)
- creates a model from a String.
Properties
Methods
-
addDef(
String sec, String key, String value) → bool - Adds an assertion to the model.
-
addPolicies(
String sec, String ptype, List< List< rules) → boolString> > -
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.inherited -
addPolicy(
String sec, String ptype, List< String> rule) → bool -
Adds a policy rule to the model.
inherited
-
buildIncrementalRoleLinks(
RoleManager rm, PolicyOperations op, String sec, String ptype, List< List< rules) → voidString> > -
inherited
-
buildRoleLinks(
RoleManager rm) → void -
Initializes the roles in RBAC.
override
-
clearPolicy(
) → void -
Clears all current policy.
inherited
-
getFilteredPolicy(
String sec, String ptype, int fieldIndex, List< String> fieldValues) → List<List< String> > -
Returns the filtered policy rules of section
sec
and policy typeptype
.inherited -
getKeySuffix(
int i) → String -
getPolicy(
String sec, String ptype) → List< List< String> > -
Returns all rules in a policy.
inherited
-
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.
inherited
-
hasPolicies(
String sec, String ptype, List< List< rules) → boolString> > -
inherited
-
hasPolicy(
String sec, String ptype, List< String> rule) → bool -
Returns whether a model has the specified policy rule.
inherited
-
loadAssertion(
Model model, Config cfg, String sec, String key) → bool -
loadModel(
String path) → void - Loads the model from model CONF file.
-
loadModelFromText(
String text) → void - Loads the model from the text.
-
loadSection(
Model model, Config cfg, String sec) → void -
loadSections(
Config cfg) → void - Helper function for loadModel
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printModel(
) → void - Prints the model to the log.
-
printPolicy(
) → void -
Prints the policy to log.
inherited
-
removeFilteredPolicy(
String sec, String ptype, int fieldIndex, List< String> fieldValues) → bool -
Removes policy rules based on field filters from the model.
inherited
-
removeFilteredPolicyReturnsEffects(
String sec, String ptype, int fieldIndex, List< String> fieldValues) → List<List< String> > -
Removes policy rules based on field filters from the model.
inherited
-
removePolicies(
String sec, String ptype, List< List< rules) → boolString> > -
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.inherited -
removePolicy(
String sec, String ptype, List< String> rule) → bool -
Removes a policy rule from the model.
inherited
-
saveModelToText(
) → String - Saves the model to the text and returns the model text.
-
savePolicyToText(
) → String -
Saves the policy to the text and returns the text.
inherited
-
saveSectionToText(
String sec) → String - Saves the section to the text and returns the section 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.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
sectionNameMap
↔ HashMap<
String, String> -
getter/setter pair